Get the URL to a named route.

@param  string $name
@param  mixed $parameters
@param  bool $absolute
@return string

@throws RouteNotFoundException
516620
public static function route( $name, $parameters = [], $absolute = true )
	{
		return static::__do( __FUNCTION__, args_with_keys( func_get_args(), __CLASS__, __FUNCTION__ ) );
	}
1270085
public function generate($name, $parameters = array(), $absolute = false)
    {
        $this->urlGenerator = new UrlGenerator($this->routeCollection, $this->context);

        return $this->urlGenerator->generate($name, $parameters, $absolute);
    }
595819
protected function generateUrl(array $urlParameters = array(), $absolute = false)
    {
        $url = $this->getCustomUrl($urlParameters);
        if ($url)
        {
            return $url;
        }

        return $this->generateStandardUrl($urlParameters);
    }
1051300
public function route($name, $parameters = array(), $absolute = true, $route = null)
    {
        return $this->forwarder()->route($name, $parameters, $absolute, $route);
    }
544900
public function route($name, $parameters = [], $secure = null)
    {
        if (! isset($this->app->router->namedRoutes[$name])) {
            throw new \InvalidArgumentException("Route [{$name}] not defined.");
        }

        $uri = $this->app->router->namedRoutes[$name];

        $parameters = $this->formatParameters($parameters);

        $uri = \preg_replace_callback('/\[([^\]]*)\]$/', function ($matches) use ($uri, &$parameters) {
            $uri = $this->replaceRouteParameters($matches[1], $parameters);

            return ($matches[1] == $uri) ? '' : $uri;
        }, $uri);

        $uri = $this->replaceRouteParameters($uri, $parameters);

        $uri = $this->to($uri, [], $secure);

        if (! empty($parameters)) {
            $uri .= '?'.\http_build_query($parameters);
        }

        return $uri;
    }
280055
public function url($route, $parameters = array())
    {
        return $this->urlGenerator->generate($route, $parameters, UrlGeneratorInterface::ABSOLUTE_URL);
    }
1364974
public static function getUrl( $name, $parameters = array(), $schemeRelative = false )
    {
        $serviceContainer = ezpKernel::instance()->getServiceContainer();

        return $serviceContainer->get('router')->generate(
            $name,
            $parameters,
            $schemeRelative ? UrlGeneratorInterface::NETWORK_PATH : UrlGeneratorInterface::ABSOLUTE_URL
        );
    }
513162
public function url($name, $params = array()) {
		if (!isset($this->namedRoutes[$name])) {
			throw new RouterException("No route matches this name : $name");
		}

		return $this->namedRoutes[$name]->getUrl($params);
	}
1373136
public function getRoutesByNames($names, $parameters = [])
    {
        $qb = $this->pageRepository->createQueryBuilder('p');
        $qb
            ->select('p.route, p.controller, t.path, t.locale')
            ->join('p.translations', 't')
            ->andWhere($qb->expr()->eq('p.static', 0))
        ;
        if (is_array($names) && !empty($names)) {
            $qb->andWhere($qb->expr()->in('p.route', $names));
        } elseif (is_string($names) && 0 < strlen($names)) {
            $qb->andWhere($qb->expr()->eq('p.route', $qb->expr()->literal($names)));
        }

        $results = $qb->getQuery()->getArrayResult();

        return $this->transformResultsToRoutes($results);
    }
1049904
public function routeModel( $name, $model, $parameters = [], $absolute = true )
	{
		if ( !$model instanceof RoutableModel )
			throw new UrlGenerationException( "The model [" . get_class( $model ) . "] must implement the RoutableModel interface." );

		if ( !is_null( $route = $this->routes->getByName( $name ) ) )
		{
			$appendedUrl = "";

			if ( is_array( $p = $model->appendRoute( $name, $parameters, $appendedUrl ) ) )
				$parameters = array_merge( $parameters, $p );

			return $this->toRoute( $route, $parameters, $absolute ) . $appendedUrl;
		}

		throw new RouteNotFoundException( "Route [{$name}] not found." );
	}
1131822
public function url($name, $params = array())
	{
		if ( ! array_key_exists($name, $this->routes))
		{
			throw new \UnexpectedValueException("A route with the name {$name} was not found");
		}

		$route = $this->routes[$name];
		return $route->url($params);
	}
1130595
public function getRouteByName($name, $parameters = [])
    {
        $qb = $this->pageRepository->createQueryBuilder('p');
        $results = $qb
            ->select('p.route, p.controller, t.path, t.locale')
            ->join('p.translations', 't')
            ->andWhere($qb->expr()->eq('p.static', 0))
            ->andWhere($qb->expr()->eq('p.route', $qb->expr()->literal($name)))
            ->getQuery()
            ->getArrayResult()
        ;

        $routes = $this->transformResultsToRoutes($results);
        if (count($routes) == 1) {
            return current($routes);
        }

        return null;
    }
842092
public function generate($name, $parameters = [], $referenceType = self::ABSOLUTE_PATH): string
    {
        if (!$name instanceof Content && !$name instanceof ContentInfo) {
            throw new RouteNotFoundException('Could not match route');
        }

        if (empty($name->mainLocationId)) {
            throw new LogicException('Cannot generate an UrlAlias route for content without main location.');
        }

        return $this->generator->generate(
            $name->mainLocation->innerLocation,
            $parameters,
            $referenceType
        );
    }
600326
public function signedRoute($name, $parameters = [], $expiration = null, $absolute = true)
    {
        $parameters = $this->formatParameters($parameters);

        if ($expiration) {
            $parameters = $parameters + ['expires' => $this->availableAt($expiration)];
        }

        ksort($parameters);

        $key = call_user_func($this->keyResolver);

        return $this->route($name, $parameters + [
            'signature' => hash_hmac('sha256', $this->route($name, $parameters, $absolute), $key),
        ], $absolute);
    }
257233
public function getAssembledUrl(
		array $parameters=[], bool $is_absolute = false, bool $force_tls = false
	) :string {
		// declare a variable for the assembled url
		$url = $this->url;
		// for each of this url's possible parameters
		foreach($this->indexedParameters as $index => $parameter_name) {
			// if a replacement value has been provided
			$replacement = isset($parameters[$parameter_name]) ? $parameters[$parameter_name] . '/' : '';
			// replace with the value in the url, or remove the parameter placeholder
			$url = str_replace([":{$parameter_name}/",'{'.$parameter_name.'}'] , $replacement , $url);
		}
		// return the assembled route with an absolute prefix if necessary
		return $is_absolute ? Route\Helper::prefixIt($url, $force_tls) : $url;

	}
337068
public function route($name, $parameters = [])
    {
        $route = router()->route($name);
        if (is_null($route)) {
            throw new \Exception("Route name [$name] not found");
        }

        $route_url = $route->url($parameters);

        return $this->to($route_url);
    }
1070789
public function route($name, array $params = [], $absolute = false)
    {
        $route = $this->router->route($name, $params);
        return $absolute
            ? $this->request->getSchemeAndHttpHost() . $route
            : $route;
    }