public function UltimenuBlock::getDerivativeDefinitions in Ultimenu 8.2
Same name and namespace in other branches
- 8 src/Plugin/Derivative/UltimenuBlock.php \Drupal\ultimenu\Plugin\Derivative\UltimenuBlock::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/ UltimenuBlock.php, line 49
Class
- UltimenuBlock
- Provides block plugin definitions for Ultimenu.
Namespace
Drupal\ultimenu\Plugin\DerivativeCode
public function getDerivativeDefinitions($base_plugin_definition) {
// Provide a block plugin definition for each ultimenu.
foreach ($this->ultimenuManager
->getUltimenuBlocks() as $key => $name) {
$menu_key = 'ultimenu-' . $key;
$this->derivatives[$menu_key] = $base_plugin_definition;
$this->derivatives[$menu_key]['admin_label'] = $this
->t("Ultimenu: @name", [
'@name' => $name,
]);
}
return parent::getDerivativeDefinitions($base_plugin_definition);
}