WeMegaMenuBlock.php in Drupal Mega Menu 8
File
src/Plugin/Derivative/WeMegaMenuBlock.php
View source
<?php
namespace Drupal\we_megamenu\Plugin\Derivative;
use Drupal\Component\Plugin\Derivative\DeriverBase;
class WeMegaMenuBlock extends DeriverBase {
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;
}
}