function MenuLinkManager::loadLinksByRoute

Same name in other branches
  1. 9 core/lib/Drupal/Core/Menu/MenuLinkManager.php \Drupal\Core\Menu\MenuLinkManager::loadLinksByRoute()
  2. 8.9.x core/lib/Drupal/Core/Menu/MenuLinkManager.php \Drupal\Core\Menu\MenuLinkManager::loadLinksByRoute()
  3. 10 core/lib/Drupal/Core/Menu/MenuLinkManager.php \Drupal\Core\Menu\MenuLinkManager::loadLinksByRoute()

Overrides MenuLinkManagerInterface::loadLinksByRoute

File

core/lib/Drupal/Core/Menu/MenuLinkManager.php, line 295

Class

MenuLinkManager
Manages discovery, instantiation, and tree building of menu link plugins.

Namespace

Drupal\Core\Menu

Code

public function loadLinksByRoute($route_name, array $route_parameters = [], $menu_name = NULL) {
    $instances = [];
    $loaded = $this->treeStorage
        ->loadByRoute($route_name, $route_parameters, $menu_name);
    foreach ($loaded as $plugin_id => $definition) {
        $instances[$plugin_id] = $this->createInstance($plugin_id);
    }
    return $instances;
}

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