public function Router::generate

Generates a URL from the given parameters.

If the generator is not able to generate the url, it must throw the RouteNotFoundException as documented below.

@api

Parameters

string $name The name of the route:

mixed $parameters An array of parameters:

Boolean $absolute Whether to generate an absolute URL:

Return value

string The generated URL

Throws

RouteNotFoundException if route doesn't exist

Overrides UrlGeneratorInterface::generate

File

drupal/core/vendor/symfony/routing/Symfony/Component/Routing/Router.php, line 170

Class

Router
The Router class is an example of the integration of all pieces of the routing system for easier use.

Namespace

Symfony\Component\Routing

Code

public function generate($name, $parameters = array(), $absolute = false) {
  return $this
    ->getGenerator()
    ->generate($name, $parameters, $absolute);
}