function SystemMenuBlock::__construct

Same name in this branch
  1. 9 core/modules/system/src/Plugin/Derivative/SystemMenuBlock.php \Drupal\system\Plugin\Derivative\SystemMenuBlock::__construct()
Same name in other branches
  1. 8.9.x core/modules/system/src/Plugin/Derivative/SystemMenuBlock.php \Drupal\system\Plugin\Derivative\SystemMenuBlock::__construct()
  2. 8.9.x core/modules/system/src/Plugin/Block/SystemMenuBlock.php \Drupal\system\Plugin\Block\SystemMenuBlock::__construct()
  3. 10 core/modules/system/src/Plugin/Derivative/SystemMenuBlock.php \Drupal\system\Plugin\Derivative\SystemMenuBlock::__construct()
  4. 10 core/modules/system/src/Plugin/Block/SystemMenuBlock.php \Drupal\system\Plugin\Block\SystemMenuBlock::__construct()
  5. 11.x core/modules/system/src/Plugin/Derivative/SystemMenuBlock.php \Drupal\system\Plugin\Derivative\SystemMenuBlock::__construct()
  6. 11.x core/modules/system/src/Plugin/Block/SystemMenuBlock.php \Drupal\system\Plugin\Block\SystemMenuBlock::__construct()

Constructs a new SystemMenuBlock.

Parameters

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

string $plugin_id: The plugin_id for the plugin instance.

array $plugin_definition: The plugin implementation definition.

\Drupal\Core\Menu\MenuLinkTreeInterface $menu_tree: The menu tree service.

\Drupal\Core\Menu\MenuActiveTrailInterface $menu_active_trail: The active menu trail service.

Overrides BlockPluginTrait::__construct

File

core/modules/system/src/Plugin/Block/SystemMenuBlock.php, line 57

Class

SystemMenuBlock
Provides a generic Menu block.

Namespace

Drupal\system\Plugin\Block

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, MenuLinkTreeInterface $menu_tree, MenuActiveTrailInterface $menu_active_trail) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    $this->menuTree = $menu_tree;
    $this->menuActiveTrail = $menu_active_trail;
}

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