class MenuBlock in Menu Block 8
Same name in this branch
- 8 src/Plugin/Derivative/MenuBlock.php \Drupal\menu_block\Plugin\Derivative\MenuBlock
- 8 src/Plugin/Block/MenuBlock.php \Drupal\menu_block\Plugin\Block\MenuBlock
Provides block plugin definitions for custom menus.
Hierarchy
- class \Drupal\Component\Plugin\Derivative\DeriverBase implements DeriverInterface
- class \Drupal\system\Plugin\Derivative\SystemMenuBlock implements ContainerDeriverInterface
- class \Drupal\menu_block\Plugin\Derivative\MenuBlock
- class \Drupal\system\Plugin\Derivative\SystemMenuBlock implements ContainerDeriverInterface
Expanded class hierarchy of MenuBlock
See also
\Drupal\system\Plugin\Block\SystemMenuBlock
File
- src/
Plugin/ Derivative/ MenuBlock.php, line 12
Namespace
Drupal\menu_block\Plugin\DerivativeView source
class MenuBlock extends SystemMenuBlock {
/**
* {@inheritdoc}
*/
public function getDerivativeDefinitions($base_plugin_definition) {
foreach ($this->menuStorage
->loadMultiple() as $menu => $entity) {
$this->derivatives[$menu] = $base_plugin_definition;
$this->derivatives[$menu]['admin_label'] = $entity
->label();
$this->derivatives[$menu]['config_dependencies']['config'] = [
$entity
->getConfigDependencyName(),
];
}
return $this->derivatives;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DeriverBase:: |
protected | property | List of derivative definitions. | 1 |
DeriverBase:: |
public | function |
Gets the definition of a derivative plugin. Overrides DeriverInterface:: |
|
MenuBlock:: |
public | function |
Gets the definition of all derivatives of a base plugin. Overrides SystemMenuBlock:: |
|
SystemMenuBlock:: |
protected | property | The menu storage. | |
SystemMenuBlock:: |
public static | function |
Creates a new class instance. Overrides ContainerDeriverInterface:: |
|
SystemMenuBlock:: |
public | function | Constructs new SystemMenuBlock. |