public function MenuLinkTreeInterface::build in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Menu/MenuLinkTreeInterface.php \Drupal\Core\Menu\MenuLinkTreeInterface::build()
- 9 core/lib/Drupal/Core/Menu/MenuLinkTreeInterface.php \Drupal\Core\Menu\MenuLinkTreeInterface::build()
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
- core/
lib/ Drupal/ Core/ Menu/ MenuLinkTreeInterface.php, line 94
Class
- MenuLinkTreeInterface
- Defines an interface for loading, transforming and rendering menu link trees.
Namespace
Drupal\Core\MenuCode
public function build(array $tree);