function MenuLinkTree::getCurrentRouteMenuTreeParameters

Same name in other branches
  1. 9 core/lib/Drupal/Core/Menu/MenuLinkTree.php \Drupal\Core\Menu\MenuLinkTree::getCurrentRouteMenuTreeParameters()
  2. 10 core/lib/Drupal/Core/Menu/MenuLinkTree.php \Drupal\Core\Menu\MenuLinkTree::getCurrentRouteMenuTreeParameters()
  3. 11.x core/lib/Drupal/Core/Menu/MenuLinkTree.php \Drupal\Core\Menu\MenuLinkTree::getCurrentRouteMenuTreeParameters()

Overrides MenuLinkTreeInterface::getCurrentRouteMenuTreeParameters

File

core/lib/Drupal/Core/Menu/MenuLinkTree.php, line 77

Class

MenuLinkTree
Implements the loading, transforming and rendering of menu link trees.

Namespace

Drupal\Core\Menu

Code

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.