public function AssetCache::dump

Applies dump filters and returns the asset as a string.

You may provide an additional filter to apply during dump.

Dumping an asset should not change its state.

If the current asset has not been loaded yet, it should be automatically loaded at this time.

Parameters

FilterInterface $additionalFilter An additional filter:

Return value

string The filtered content of the current asset

Overrides AssetInterface::dump

File

drupal/core/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCache.php, line 62

Class

AssetCache
Caches an asset to avoid the cost of loading and dumping.

Namespace

Assetic\Asset

Code

public function dump(FilterInterface $additionalFilter = null) {
  $cacheKey = self::getCacheKey($this->asset, $additionalFilter, 'dump');
  if ($this->cache
    ->has($cacheKey)) {
    return $this->cache
      ->get($cacheKey);
  }
  $content = $this->asset
    ->dump($additionalFilter);
  $this->cache
    ->set($cacheKey, $content);
  return $content;
}