You are here

public function JumpMenuBlock::getDerivativeDefinitions in Better Jump Menus 8

File

lib/Drupal/jump_menu/Plugin/Derivative/JumpMenuBlock.php, line 51
Contains \Drupal\jump_menu\Plugin\Derivative\JumpMenuBlock.

Class

JumpMenuBlock
Provides jump menu block plugin definitions for custom menus.

Namespace

Drupal\jump_menu\Plugin\Derivative

Code

public function getDerivativeDefinitions(array $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]['cache'] = DRUPAL_NO_CACHE;
  }
  return $this->derivatives;
}