public function MenuLinkTr8b7c:f320:99b9:690f:4595:cd17:293a:c069getCurrentRouteMenuTreeParameters public MenuLinkTr8b7c:f320:99b9:690f:4595:cd17:293a:c069getCurrentRouteMenuTreeParameters($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_name: The menu name, needed for retrieving the active trail and links with the 'expanded' flag enabled. Return value  \Drupal\Core\Menu\MenuTreeParameters The parameters to determine which menu links to be loaded into a tree. Overrides MenuLinkTreeInter8b7c:f320:99b9:690f:4595:cd17:293a:c069getCurrentRouteMenuTreeParameters See also  \Drupal\Core\Menu\MenuTreeParameters File
 core/lib/Drupal/Core/Menu/MenuLinkTree.php, line 70  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)
    // We want links in the active trail to be expanded.
    ->addExpandedParents($active_trail)
    // We marked the links in the active trail to be expanded, but we also
    // want their descendants that have the "expanded" flag enabled to be
    // expanded.
    ->addExpandedParents($this->treeStorage->getExpanded($menu_name, $active_trail));

  return $parameters;
}


    
{'path': 'public/docs/drupal~8/core-lib-drupal-core-menu-menulinktree.php/function/menulinktree-getcurrentroutemenutreeparameters/8.1.x.html', 'source': 'DevDocs.IO'}