public function MenuLinkTree::getCurrentRouteMenuTreeParameters in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Menu/MenuLinkTree.php \Drupal\Core\Menu\MenuLinkTree::getCurrentRouteMenuTreeParameters()
- 9 core/lib/Drupal/Core/Menu/MenuLinkTree.php \Drupal\Core\Menu\MenuLinkTree::getCurrentRouteMenuTreeParameters()
File
- core/
lib/ Drupal/ Core/ Menu/ MenuLinkTree.php, line 78
Class
- MenuLinkTree
- Implements the loading, transforming and rendering of menu link trees.
Namespace
Drupal\Core\MenuCode
public function getCurrentRouteMenuTreeParameters($menu_name) {
$active_trail = $this->menuActiveTrail
->getActiveTrailIds($menu_name);
$parameters = new MenuTreeParameters();
$parameters
->setActiveTrail($active_trail)
->addExpandedParents($active_trail)
->addExpandedParents($this->treeStorage
->getExpanded($menu_name, $active_trail));
return $parameters;
}