You are here

public function CssCollectionRenderer::__construct in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Asset/CssCollectionRenderer.php \Drupal\Core\Asset\CssCollectionRenderer::__construct()

Constructs a CssCollectionRenderer.

Parameters

\Drupal\Core\State\StateInterface $state: The state key/value store.

\Drupal\Core\File\FileUrlGeneratorInterface $file_url_generator: The file URL generator.

File

core/lib/Drupal/Core/Asset/CssCollectionRenderer.php, line 35

Class

CssCollectionRenderer
Renders CSS assets.

Namespace

Drupal\Core\Asset

Code

public function __construct(StateInterface $state, FileUrlGeneratorInterface $file_url_generator = NULL) {
  $this->state = $state;
  if (!$file_url_generator) {
    @trigger_error('Calling CssCollectionRenderer::__construct() without the $file_url_generator argument is deprecated in drupal:9.3.0 and will be required before drupal:10.0.0. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
    $file_url_generator = \Drupal::service('file_url_generator');
  }
  $this->fileUrlGenerator = $file_url_generator;
}