function RouteProvider::getRoutesByNames

Same name in this branch
  1. 11.x core/tests/Drupal/KernelTests/RouteProvider.php \Drupal\KernelTests\RouteProvider::getRoutesByNames()
Same name in other branches
  1. 9 core/tests/Drupal/KernelTests/RouteProvider.php \Drupal\KernelTests\RouteProvider::getRoutesByNames()
  2. 9 core/lib/Drupal/Core/Routing/RouteProvider.php \Drupal\Core\Routing\RouteProvider::getRoutesByNames()
  3. 8.9.x core/tests/Drupal/KernelTests/RouteProvider.php \Drupal\KernelTests\RouteProvider::getRoutesByNames()
  4. 8.9.x core/lib/Drupal/Core/Routing/RouteProvider.php \Drupal\Core\Routing\RouteProvider::getRoutesByNames()
  5. 10 core/tests/Drupal/KernelTests/RouteProvider.php \Drupal\KernelTests\RouteProvider::getRoutesByNames()
  6. 10 core/lib/Drupal/Core/Routing/RouteProvider.php \Drupal\Core\Routing\RouteProvider::getRoutesByNames()

Overrides RouteProviderInterface::getRoutesByNames

1 call to RouteProvider::getRoutesByNames()
RouteProvider::getRouteByName in core/lib/Drupal/Core/Routing/RouteProvider.php
Find the route using the provided route name.

File

core/lib/Drupal/Core/Routing/RouteProvider.php, line 251

Class

RouteProvider
A Route Provider front-end for all Drupal-stored routes.

Namespace

Drupal\Core\Routing

Code

public function getRoutesByNames($names) {
    $this->preLoadRoutes($names);
    foreach ($names as $name) {
        // The specified route name might not exist or might be serialized.
        if (!isset($this->routes[$name]) && isset($this->serializedRoutes[$name])) {
            $this->routes[$name] = unserialize($this->serializedRoutes[$name]);
            unset($this->serializedRoutes[$name]);
        }
    }
    return array_intersect_key($this->routes, array_flip($names));
}

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