public function TBMegaMenuBuilder::getMenuItem in The Better Mega Menu 8
Same name and namespace in other branches
- 2.x src/TBMegaMenuBuilder.php \Drupal\tb_megamenu\TBMegaMenuBuilder::getMenuItem()
Find a menu item.
Parameters
string $menu_name: Menu machine name.
string $plugin_id: The menu item plugin id.
Return value
\Drupal\Core\Menu\MenuLinkTreeElement The menu item element.
Overrides TBMegaMenuBuilderInterface::getMenuItem
File
- src/
TBMegaMenuBuilder.php, line 103
Class
- TBMegaMenuBuilder
- Defines a TBMegaMenuBuilder.
Namespace
Drupal\tb_megamenuCode
public function getMenuItem(string $menu_name, string $plugin_id) {
$tree =& drupal_static(__FUNCTION__);
if (is_null($tree)) {
$tree = $this->menuTree
->load($menu_name, (new MenuTreeParameters())
->onlyEnabledLinks());
}
$item = self::findMenuItem($tree, $plugin_id);
return $item;
}