function LanguageRequestSubscriber::__construct

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

Constructs a LanguageRequestSubscriber object.

Parameters

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

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

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

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

File

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

Class

LanguageRequestSubscriber
Sets the $request property on the language manager.

Namespace

Drupal\language\EventSubscriber

Code

public function __construct(ConfigurableLanguageManagerInterface $language_manager, LanguageNegotiatorInterface $negotiator, TranslatorInterface $translation, AccountInterface $current_user) {
    $this->languageManager = $language_manager;
    $this->negotiator = $negotiator;
    $this->translation = $translation;
    $this->currentUser = $current_user;
}

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