refactoring asset version handling.

This commit is contained in:
Taylor Otwell 2011-08-11 22:05:41 -05:00
parent a0c7db34fc
commit 0beec68355
1 changed files with 4 additions and 2 deletions

View File

@ -122,9 +122,11 @@ public function __construct($name)
*/
public function add($name, $source, $dependencies = array(), $attributes = array())
{
$_source = explode('?', $source);
// Since assets may contain timestamps to force a refresh, we will strip them
// off to get the "real" filename of the asset.
$segments = explode('?', $source);
$type = (File::extension($_source[0]) == 'css') ? 'style' : 'script';
$type = (File::extension($segments[0]) == 'css') ? 'style' : 'script';
return call_user_func(array($this, $type), $name, $source, $dependencies, $attributes);
}