public function LazyAssetManager::load

Loads formulae from resources.

Throws

\LogicException If a resource has been added to an invalid loader

5 calls to LazyAssetManager::load()
LazyAssetManager::get in drupal/core/vendor/kriswallsmith/assetic/src/Assetic/Factory/LazyAssetManager.php
Gets an asset by name.
LazyAssetManager::getFormula in drupal/core/vendor/kriswallsmith/assetic/src/Assetic/Factory/LazyAssetManager.php
Returns an asset's formula.
LazyAssetManager::getNames in drupal/core/vendor/kriswallsmith/assetic/src/Assetic/Factory/LazyAssetManager.php
Returns an array of asset names.
LazyAssetManager::has in drupal/core/vendor/kriswallsmith/assetic/src/Assetic/Factory/LazyAssetManager.php
Checks if the current asset manager has a certain asset.
LazyAssetManager::hasFormula in drupal/core/vendor/kriswallsmith/assetic/src/Assetic/Factory/LazyAssetManager.php
Checks for an asset formula.

File

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

Class

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

Namespace

Assetic\Factory

Code

public function load() {
  if ($this->loading) {
    return;
  }
  if ($diff = array_diff(array_keys($this->resources), array_keys($this->loaders))) {
    throw new \LogicException('The following loader(s) are not registered: ' . implode(', ', $diff));
  }
  $this->loading = true;
  foreach ($this->resources as $loader => $resources) {
    foreach ($resources as $resource) {
      $this->formulae = array_replace($this->formulae, $this->loaders[$loader]
        ->load($resource));
    }
  }
  $this->loaded = true;
  $this->loading = false;
}