Refactoring Asset class.
This commit is contained in:
parent
ed52c19e05
commit
24ba87f5de
|
@ -76,7 +76,9 @@ public function __construct($name)
|
|||
*/
|
||||
public function add($name, $source, $dependencies = array(), $attributes = array())
|
||||
{
|
||||
return call_user_func(array($this, (File::extension($source) == 'css') ? 'style' : 'script'), $name, $source, $dependencies, $attributes);
|
||||
$type = (File::extension($source) == 'css') ? 'style' : 'script';
|
||||
|
||||
return call_user_func(array($this, $type), $name, $source, $dependencies, $attributes);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -200,10 +202,7 @@ public function get_script($name)
|
|||
*/
|
||||
private function get_asset($group, $name)
|
||||
{
|
||||
if ( ! isset($this->assets[$group][$name]))
|
||||
{
|
||||
return '';
|
||||
}
|
||||
if ( ! isset($this->assets[$group][$name])) return '';
|
||||
|
||||
$asset = $this->assets[$group][$name];
|
||||
|
||||
|
|
Loading…
Reference in New Issue