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;
} /**
* {@inheritdoc}
*/
public function load($menu_name, MenuTreeParameters
$parameters) { $data =
$this->treeStorage->
loadTreeData($menu_name,
$parameters);
// Pre-load all the route objects in the tree for access checks.
if ($data['route_names'
] &&
$this->routeProvider instanceof PreloadableRouteProviderInterface
) {