You are here

public function WeMegaMenuBlock::getDerivativeDefinitions in Drupal Mega Menu 8

Same name and namespace in other branches
  1. 8.x src/Plugin/Derivative/WeMegaMenuBlock.php \Drupal\we_megamenu\Plugin\Derivative\WeMegaMenuBlock::getDerivativeDefinitions()

Gets the definition of all derivatives of a base plugin.

Parameters

array $base_plugin_definition: The definition array of the base plugin.

Return value

array An array of full derivative definitions keyed on derivative id.

Overrides DeriverBase::getDerivativeDefinitions

See also

getDerivativeDefinition()

File

src/Plugin/Derivative/WeMegaMenuBlock.php, line 14

Class

WeMegaMenuBlock
Provides blocks which belong to Drupal 8 Mega Menu.

Namespace

Drupal\we_megamenu\Plugin\Derivative

Code

public function getDerivativeDefinitions($base_plugin_definition) {
  $menus = menu_ui_get_menus();
  foreach ($menus as $menu => $title) {
    $this->derivatives[$menu] = $base_plugin_definition;
    $this->derivatives[$menu]['admin_label'] = $title;
  }
  return $this->derivatives;
}