MenuLinkTreeInterface::getCurrentRouteMenuTreeParameters

public MenuLinkTreeInterface::getCurrentRouteMenuTreeParameters($menu_name) Gets the link tree parameters for rendering a specific menu. Builds menu link tree parameters that: Expand all links in the active trail based on route being viewed. Expand the descendents of the links in the active trail whose 'expanded' flag is enabled. This only sets the (relatively complex) parameters to achieve the two above goals, but you can still further customize these parameters. Parameters string $menu_nam

MenuLinkTreeInterface::build

public MenuLinkTreeInterface::build(array $tree) Builds a renderable array from a menu tree. The menu item's LI element is given one of the following classes: expanded: The menu item is showing its submenu. collapsed: The menu item has a submenu that is not shown. leaf: The menu item has no submenu. Parameters \Drupal\Core\Menu\MenuLinkTreeElement[] $tree: A data structure representing the tree, as returned from MenuLinkTreeInterface::load(). Return value array A renderable array. File c

MenuLinkTreeInterface

Defines an interface for loading, transforming and rendering menu link trees. The main purposes of this interface are: Load a list of menu links, given a menu name, using MenuLinkTreeInterface::load(). Loaded menu links are returned as a tree by looking at the links' tree meta-data. Which links are loaded can be specified in the menu link tree parameters that are passed to the load() method. You can build your own set of parameters, or you can start from typical defaults by calling the MenuLink

MenuLinkTreeElement::__construct

public MenuLinkTreeElement::__construct(MenuLinkInterface $link, $has_children, $depth, $in_active_trail, array $subtree) Constructs a new \Drupal\Core\Menu\MenuLinkTreeElement. Parameters \Drupal\Core\Menu\MenuLinkInterface $link: The menu link for this element in the menu link tree. bool $has_children: A flag as to whether this element has children even if they are not included in the tree (i.e. this may be TRUE even if $subtree is empty). int $depth: The depth of this element relative to th

MenuLinkTreeElement::count

public MenuLinkTreeElement::count() Counts all menu links in the current subtree. Return value int The number of menu links in this subtree (one plus the number of menu links in all descendants). File core/lib/Drupal/Core/Menu/MenuLinkTreeElement.php, line 116 Class MenuLinkTreeElement Provides a value object to model an element in a menu link tree. Namespace Drupal\Core\Menu Code public function count() { $sum = function($carry, MenuLinkTreeElement $element) { return $carry + $

MenuLinkTreeElement::$subtree

The subtree of this element in the menu link tree (this link's children). (Children of a link are only loaded if a link is marked as "expanded" by the query.) Type: \Drupal\Core\Menu\MenuLinkTreeElement[] File core/lib/Drupal/Core/Menu/MenuLinkTreeElement.php, line 42 Class MenuLinkTreeElement Provides a value object to model an element in a menu link tree. Namespace Drupal\Core\Menu Code public $subtree;

MenuLinkTreeElement::$options

Additional options for this link. This is merged (\Drupal\Component\Utility\NestedArray::mergeDeep()) with \Drupal\Core\Menu\MenuLinkInterface::getOptions(), to allow menu link tree manipulators to add or override link options. File core/lib/Drupal/Core/Menu/MenuLinkTreeElement.php, line 82 Class MenuLinkTreeElement Provides a value object to model an element in a menu link tree. Namespace Drupal\Core\Menu Code public $options = array();

MenuLinkTreeElement::$link

The menu link for this element in a menu link tree. Type: \Drupal\Core\Menu\MenuLinkInterface File core/lib/Drupal/Core/Menu/MenuLinkTreeElement.php, line 32 Class MenuLinkTreeElement Provides a value object to model an element in a menu link tree. Namespace Drupal\Core\Menu Code public $link;

MenuLinkTreeElement::$inActiveTrail

Whether this link is in the active trail. Type: bool File core/lib/Drupal/Core/Menu/MenuLinkTreeElement.php, line 63 Class MenuLinkTreeElement Provides a value object to model an element in a menu link tree. Namespace Drupal\Core\Menu Code public $inActiveTrail;

MenuLinkTreeElement::$hasChildren

Whether this link has any children at all. Type: bool File core/lib/Drupal/Core/Menu/MenuLinkTreeElement.php, line 56 Class MenuLinkTreeElement Provides a value object to model an element in a menu link tree. Namespace Drupal\Core\Menu Code public $hasChildren;