public RouteProvider::getRouteByName($name)
Find the route using the provided route name (and parameters).
string $name: The route name to fetch
\Symfony\Component\Routing\Route The found route.
\Symfony\Component\Routing\Exception\RouteNotFoundException Thrown if there is no route with that name in this repository.
Overrides RouteProviderInterface::getRouteByName
public function getRouteByName($name) { $routes = $this->getRoutesByNames(array($name)); if (empty($routes)) { throw new RouteNotFoundException(sprintf('Route "%s" does not exist.', $name)); } return reset($routes); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Routing!RouteProvider.php/function/RouteProvider::getRouteByName/8.1.x