function LanguageRequestSubscriber::__construct

Same name and namespace in other branches
  1. 10 core/modules/language/src/EventSubscriber/LanguageRequestSubscriber.php \Drupal\language\EventSubscriber\LanguageRequestSubscriber::__construct()
  2. 11.x core/modules/language/src/EventSubscriber/LanguageRequestSubscriber.php \Drupal\language\EventSubscriber\LanguageRequestSubscriber::__construct()
  3. 9 core/modules/language/src/EventSubscriber/LanguageRequestSubscriber.php \Drupal\language\EventSubscriber\LanguageRequestSubscriber::__construct()
  4. 8.9.x core/modules/language/src/EventSubscriber/LanguageRequestSubscriber.php \Drupal\language\EventSubscriber\LanguageRequestSubscriber::__construct()

Constructs a LanguageRequestSubscriber object.

Parameters

\Drupal\language\ConfigurableLanguageManagerInterface $languageManager: The language manager service.

\Drupal\language\LanguageNegotiatorInterface $negotiator: The language negotiator.

\Drupal\Core\StringTranslation\Translator\TranslatorInterface $translation: The translation service.

\Drupal\Core\Session\AccountInterface $currentUser: The current active user.

File

core/modules/language/src/EventSubscriber/LanguageRequestSubscriber.php, line 31

Class

LanguageRequestSubscriber
Sets the $request property on the language manager.

Namespace

Drupal\language\EventSubscriber

Code

public function __construct(protected ConfigurableLanguageManagerInterface $languageManager, protected LanguageNegotiatorInterface $negotiator, protected TranslatorInterface $translation, protected AccountInterface $currentUser) {
}

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