function AssetCollectionOptimizerInterface::optimize

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Asset/AssetCollectionOptimizerInterface.php \Drupal\Core\Asset\AssetCollectionOptimizerInterface::optimize()
  2. 10 core/lib/Drupal/Core/Asset/AssetCollectionOptimizerInterface.php \Drupal\Core\Asset\AssetCollectionOptimizerInterface::optimize()
  3. 11.x core/lib/Drupal/Core/Asset/AssetCollectionOptimizerInterface.php \Drupal\Core\Asset\AssetCollectionOptimizerInterface::optimize()

Optimizes a collection of assets.

Parameters

array $assets: An asset collection.

Return value

array An optimized asset collection.

2 methods override AssetCollectionOptimizerInterface::optimize()
CssCollectionOptimizer::optimize in core/lib/Drupal/Core/Asset/CssCollectionOptimizer.php
The cache file name is retrieved on a page load via a lookup variable that contains an associative array. The array key is the hash of the file names in $css while the value is the cache file name. The cache file is generated in two cases. First, if…
JsCollectionOptimizer::optimize in core/lib/Drupal/Core/Asset/JsCollectionOptimizer.php
The cache file name is retrieved on a page load via a lookup variable that contains an associative array. The array key is the hash of the names in $files while the value is the cache file name. The cache file is generated in two cases. First, if…

File

core/lib/Drupal/Core/Asset/AssetCollectionOptimizerInterface.php, line 19

Class

AssetCollectionOptimizerInterface
Interface defining a service that optimizes a collection of assets.

Namespace

Drupal\Core\Asset

Code

public function optimize(array $assets);

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.