Example #1
0
 /**
  * Add an asset to the container.
  *
  * The extension of the asset source will be used to determine the type of
  * asset being registered (CSS or JavaScript). If you are using a non-standard
  * extension, you may use the style or script methods to register assets.
  *
  * You may also specify asset dependencies. This will instruct the class to
  * only link to the registered asset after its dependencies have been linked.
  * For example, you may wish to make jQuery UI dependent on jQuery.
  *
  * @param  string  $name
  * @param  string  $source
  * @param  array   $dependencies
  * @param  array   $attributes
  * @return void
  */
 public function add($name, $source, $dependencies = array(), $attributes = array())
 {
     $type = File::extension($source) == 'css' ? 'style' : 'script';
     return call_user_func(array($this, $type), $name, $source, $dependencies, $attributes);
 }