You are here

public function MenuLinkTree::load in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Menu/MenuLinkTree.php \Drupal\Core\Menu\MenuLinkTree::load()
  2. 9 core/lib/Drupal/Core/Menu/MenuLinkTree.php \Drupal\Core\Menu\MenuLinkTree::load()

File

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

Class

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

Namespace

Drupal\Core\Menu

Code

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) {
    $this->routeProvider
      ->getRoutesByNames($data['route_names']);
  }
  return $this
    ->createInstances($data['tree']);
}