Commit 24ba87f5 authored by Taylor Otwell's avatar Taylor Otwell

Refactoring Asset class.

parent ed52c19e
......@@ -76,7 +76,9 @@ class Asset_Container {
*/
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 @@ class Asset_Container {
*/
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];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment