You are here

class WeMegaMenuBlock in Drupal Mega Menu 8

Same name in this branch
  1. 8 src/Plugin/Derivative/WeMegaMenuBlock.php \Drupal\we_megamenu\Plugin\Derivative\WeMegaMenuBlock
  2. 8 src/Plugin/Block/WeMegaMenuBlock.php \Drupal\we_megamenu\Plugin\Block\WeMegaMenuBlock
Same name and namespace in other branches
  1. 8.x src/Plugin/Derivative/WeMegaMenuBlock.php \Drupal\we_megamenu\Plugin\Derivative\WeMegaMenuBlock

Provides blocks which belong to Drupal 8 Mega Menu.

Hierarchy

Expanded class hierarchy of WeMegaMenuBlock

File

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

Namespace

Drupal\we_megamenu\Plugin\Derivative
View source
class WeMegaMenuBlock extends DeriverBase {

  /**
   * {@inheritdoc}
   */
  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;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DeriverBase::$derivatives protected property List of derivative definitions. 1
DeriverBase::getDerivativeDefinition public function Gets the definition of a derivative plugin. Overrides DeriverInterface::getDerivativeDefinition
WeMegaMenuBlock::getDerivativeDefinitions public function Gets the definition of all derivatives of a base plugin. Overrides DeriverBase::getDerivativeDefinitions