function LanguageBlock::__construct

Same name in other branches
  1. 9 core/modules/language/src/Plugin/Block/LanguageBlock.php \Drupal\language\Plugin\Block\LanguageBlock::__construct()
  2. 8.9.x core/modules/language/src/Plugin/Block/LanguageBlock.php \Drupal\language\Plugin\Block\LanguageBlock::__construct()
  3. 11.x core/modules/language/src/Plugin/Block/LanguageBlock.php \Drupal\language\Plugin\Block\LanguageBlock::__construct()

Constructs a LanguageBlock object.

Parameters

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin ID for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

\Drupal\Core\Language\LanguageManagerInterface $language_manager: The language manager.

\Drupal\Core\Path\PathMatcherInterface $path_matcher: The path matcher.

Overrides BlockPluginTrait::__construct

File

core/modules/language/src/Plugin/Block/LanguageBlock.php, line 56

Class

LanguageBlock
Provides a 'Language switcher' block.

Namespace

Drupal\language\Plugin\Block

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, LanguageManagerInterface $language_manager, PathMatcherInterface $path_matcher) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    $this->languageManager = $language_manager;
    $this->pathMatcher = $path_matcher;
}

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