public function LazyAssetManager::get

Gets an asset by name.

Parameters

string $name The asset name:

Return value

AssetInterface The asset

Throws

\InvalidArgumentException If there is no asset by that name

Overrides AssetManager::get

File

drupal/core/vendor/kriswallsmith/assetic/src/Assetic/Factory/LazyAssetManager.php, line 167

Class

LazyAssetManager
A lazy asset manager is a composition of a factory and many formula loaders.

Namespace

Assetic\Factory

Code

public function get($name) {
  if (!$this->loaded) {
    $this
      ->load();
  }
  if (!parent::has($name) && isset($this->formulae[$name])) {
    list($inputs, $filters, $options) = $this->formulae[$name];
    $options['name'] = $name;
    parent::set($name, $this->factory
      ->createAsset($inputs, $filters, $options));
  }
  return parent::get($name);
}