function CssOptimizer::__construct
Same name in other branches
- 10 core/lib/Drupal/Core/Asset/CssOptimizer.php \Drupal\Core\Asset\CssOptimizer::__construct()
- 11.x core/lib/Drupal/Core/Asset/CssOptimizer.php \Drupal\Core\Asset\CssOptimizer::__construct()
Constructs a CssOptimizer.
Parameters
\Drupal\Core\File\FileUrlGeneratorInterface $file_url_generator: The file URL generator.
File
-
core/
lib/ Drupal/ Core/ Asset/ CssOptimizer.php, line 34
Class
- CssOptimizer
- Optimizes a CSS asset.
Namespace
Drupal\Core\AssetCode
public function __construct(FileUrlGeneratorInterface $file_url_generator = NULL) {
if (!$file_url_generator) {
@trigger_error('Calling CssOptimizer::__construct() without the $file_url_generator argument is deprecated in drupal:9.3.0. The $file_url_generator argument will be required in drupal:10.0.0. See https://www.drupal.org/node/2940031', E_USER_DEPRECATED);
$file_url_generator = \Drupal::service('file_url_generator');
}
$this->fileUrlGenerator = $file_url_generator;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.