public function FileAsset::load

Loads the asset into memory and applies load filters.

You may provide an additional filter to apply during load.

Parameters

FilterInterface $additionalFilter An additional filter:

Overrides AssetInterface::load

File

drupal/core/vendor/kriswallsmith/assetic/src/Assetic/Asset/FileAsset.php, line 57

Class

FileAsset
Represents an asset loaded from a file.

Namespace

Assetic\Asset

Code

public function load(FilterInterface $additionalFilter = null) {
  $source = VarUtils::resolve($this->source, $this
    ->getVars(), $this
    ->getValues());
  if (!is_file($source)) {
    throw new \RuntimeException(sprintf('The source file "%s" does not exist.', $source));
  }
  $this
    ->doLoad(file_get_contents($source), $additionalFilter);
}