function AjaxResponseAttachmentsProcessor::__construct

Same name in other branches
  1. 9 core/lib/Drupal/Core/Ajax/AjaxResponseAttachmentsProcessor.php \Drupal\Core\Ajax\AjaxResponseAttachmentsProcessor::__construct()
  2. 8.9.x core/lib/Drupal/Core/Ajax/AjaxResponseAttachmentsProcessor.php \Drupal\Core\Ajax\AjaxResponseAttachmentsProcessor::__construct()
  3. 11.x core/lib/Drupal/Core/Ajax/AjaxResponseAttachmentsProcessor.php \Drupal\Core\Ajax\AjaxResponseAttachmentsProcessor::__construct()

Constructs an AjaxResponseAttachmentsProcessor object.

Parameters

\Drupal\Core\Asset\AssetResolverInterface $asset_resolver: An asset resolver.

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: A config factory for retrieving required config objects.

\Drupal\Core\Asset\AssetCollectionRendererInterface $css_collection_renderer: The CSS asset collection renderer.

\Drupal\Core\Asset\AssetCollectionRendererInterface $js_collection_renderer: The JS asset collection renderer.

\Symfony\Component\HttpFoundation\RequestStack $request_stack: The request stack.

\Drupal\Core\Render\RendererInterface $renderer: The renderer.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler.

\Drupal\Core\Language\LanguageManagerInterface|null $languageManager: The language manager.

File

core/lib/Drupal/Core/Ajax/AjaxResponseAttachmentsProcessor.php, line 94

Class

AjaxResponseAttachmentsProcessor
Processes attachments of AJAX responses.

Namespace

Drupal\Core\Ajax

Code

public function __construct(AssetResolverInterface $asset_resolver, ConfigFactoryInterface $config_factory, AssetCollectionRendererInterface $css_collection_renderer, AssetCollectionRendererInterface $js_collection_renderer, RequestStack $request_stack, RendererInterface $renderer, ModuleHandlerInterface $module_handler, ?LanguageManagerInterface $languageManager = NULL) {
    $this->assetResolver = $asset_resolver;
    $this->config = $config_factory->get('system.performance');
    $this->cssCollectionRenderer = $css_collection_renderer;
    $this->jsCollectionRenderer = $js_collection_renderer;
    $this->requestStack = $request_stack;
    $this->renderer = $renderer;
    $this->moduleHandler = $module_handler;
    if (!isset($languageManager)) {
        @trigger_error('Calling ' . __METHOD__ . '() without the $language_manager argument is deprecated in drupal:10.1.0 and will be required in drupal:11.0.0. See https://www.drupal.org/node/3347754', E_USER_DEPRECATED);
        $this->languageManager = \Drupal::languageManager();
    }
}

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