protected function ContentAwareGenerator::getRouteByName

Get the route by a string name

Parameters

string $route:

array $parameters:

Return value

SymfonyRoute

Throws

RouteNotFoundException if there is no route found for the provided name

1 call to ContentAwareGenerator::getRouteByName()
ContentAwareGenerator::generate in drupal/core/vendor/symfony-cmf/routing/Symfony/Cmf/Component/Routing/ContentAwareGenerator.php

File

drupal/core/vendor/symfony-cmf/routing/Symfony/Cmf/Component/Routing/ContentAwareGenerator.php, line 79

Class

ContentAwareGenerator
A generator that tries to generate routes from object, route names or content objects or names.

Namespace

Symfony\Cmf\Component\Routing

Code

protected function getRouteByName($name, array $parameters) {
  $route = $this->provider
    ->getRouteByName($name, $parameters);
  if (empty($route)) {
    throw new RouteNotFoundException('No route found for name: ' . $name);
  }
  return $this
    ->getBestLocaleRoute($route, $parameters);
}