You are here

public function LanguageRequestSubscriber::__construct in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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: 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 64
Contains \Drupal\language\EventSubscriber\LanguageRequestSubscriber.

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;
}