public function AssetManager::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

1 call to AssetManager::get()
LazyAssetManager::get in drupal/core/vendor/kriswallsmith/assetic/src/Assetic/Factory/LazyAssetManager.php
Gets an asset by name.
1 method overrides AssetManager::get()
LazyAssetManager::get in drupal/core/vendor/kriswallsmith/assetic/src/Assetic/Factory/LazyAssetManager.php
Gets an asset by name.

File

drupal/core/vendor/kriswallsmith/assetic/src/Assetic/AssetManager.php, line 34

Class

AssetManager
Manages assets.

Namespace

Assetic

Code

public function get($name) {
  if (!isset($this->assets[$name])) {
    throw new \InvalidArgumentException(sprintf('There is no "%s" asset.', $name));
  }
  return $this->assets[$name];
}