MenuBlock.php in Menu Block 8
File
src/Plugin/Derivative/MenuBlock.php
View source
<?php
namespace Drupal\menu_block\Plugin\Derivative;
use Drupal\system\Plugin\Derivative\SystemMenuBlock;
class MenuBlock extends SystemMenuBlock {
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;
}
}
Classes
Name |
Description |
MenuBlock |
Provides block plugin definitions for custom menus. |