You are here

protected function ContentAwareGenerator::getRouteByName in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony-cmf/routing/ContentAwareGenerator.php \Symfony\Cmf\Component\Routing\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 vendor/symfony-cmf/routing/ContentAwareGenerator.php

File

vendor/symfony-cmf/routing/ContentAwareGenerator.php, line 98

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);
  if (empty($route)) {
    throw new RouteNotFoundException('No route found for name: ' . $name);
  }
  return $this
    ->getBestLocaleRoute($route, $parameters);
}