Create a temporary signed route URL for a named route.

@param  string  $name
@param  \DateTimeInterface|\DateInterval|int  $expiration
@param  array  $parameters
@param  bool  $absolute
@return string
172209
public function temporarySignedRoute($name, $expiration, $parameters = [], $absolute = true)
    {
        return $this->signedRoute($name, $parameters, $expiration, $absolute);
    }
702547
public static function route($path = '', $absolute = false, array $params = [])
    {
        $router = Router::getInstance();
        try {
            return $router->getRoute($path, $absolute, $params);
        } catch (\Exception $e) {
            return $router->getRoute('', $absolute, $params);
        }
    }
801477
public function redirectRoute($route, $parameters = [], $absolute = true)
    {
        $this->url = route($route, $parameters, $absolute);

        return $this;
    }
439457
public function register($name, $path, $absolute = false)
    {
        if($path instanceof \Exedra\Path)
            return $this->pathRegistry[$name] = $path;

        $path = $absolute ? $path : $this->basePath.'/'.ltrim($path, '/\\');

        $this->pathRegistry[$name] = new static($path);

        return $this->pathRegistry[$name];
    }
1159312
public function generatePath($name, array $parameters = array())
    {
        return $this->container->get('router.url_generator')->generate($name, $parameters, false);
    }
1051300
public function route($name, $parameters = array(), $absolute = true, $route = null)
    {
        return $this->forwarder()->route($name, $parameters, $absolute, $route);
    }
413631
public function functionPath(string $name, array $parameters = []): string
    {
        return $this->getApp()->getService('routing')->generate($name, $parameters);
    }
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;
    }
864199
protected function toRoute($route, $parameters, $absolute)
    {
        $parameters = $this->formatParameters($parameters);

        $domain = $this->getRouteDomain($route, $parameters);

        // Verificar se ainda tem parametros par atraduzir
        $params_orign = $parameters;
        $parameters = [];
        preg_match_all('%\\{(.*?)\\}%', $route->uri(), $params, PREG_PATTERN_ORDER);
        for ($i = 0; $i < count($params[0]); $i++) {
            $key = str_replace('?', '', $params[1][$i]);
            $val = $this->getParameterContext($key);
            if (array_key_exists($key, $params_orign)) {
                $parameters[$key] = $params_orign[$key];
            } elseif (! is_null($val)) {
                $parameters[$key] = $val;
            }
        }

        $uri = $this->addQueryString($this->trimUrl(
            $root = $this->replaceRoot($route, $domain, $parameters),
            $this->replaceRouteParameters($route->uri(), $parameters)
        ), $parameters);

        // Se ainda tiver parametros gerar erro
        if (preg_match('/\{.*?\}/', $uri)) {
            throw UrlGenerationException::forMissingParameters($route);
        }

        $uri = strtr(rawurlencode($uri), $this->dontEncode);

        return $absolute ? $uri : '/' . ltrim(str_replace($root, '', $uri), '/');
    }
910595
public function routeIf($condition, string $name, string $text, array $parameters = [], bool $absolute = true)
    {
        return $this->addIf($condition, Link::toRoute($name, $text, $parameters, $absolute));
    }
541309
public function getPath($name, $parameters = [], $relative = false)
    {
        return $this->generator->generate($name, $parameters, $relative ? UrlGeneratorInterface::RELATIVE_PATH : UrlGeneratorInterface::ABSOLUTE_PATH);
    }
1251345
public function action($action, $parameters = array(), $absolute = true)
	{
		if ($this->rootNamespace && ! (strpos($action, '\\') === 0))
		{
			$action = $this->rootNamespace.'\\'.$action;
		}
		else
		{
			$action = trim($action, '\\');
		}

		if ( ! is_null($route = $this->routes->getByAction($action)))
		{
			 return $this->toRoute($route, $parameters, $absolute);
		}

		throw new InvalidArgumentException("Action {$action} not defined.");
	}
827831
protected function generateUrl($route, array $parameters, $absolute)
    {
        $queryParams    = '';
        $resourceParams = [];

        foreach ($parameters as $paramName => $paramValue) {
            if (strpos(strtolower($paramName), 'id') !== false) {
                $resourceParams[$paramName] = $paramValue;
                continue;
            }

            $queryParams .= $paramName . '=' . $paramValue . '&';
        }

        if ($queryParams !== '') {
            $queryParams = '?' . substr($queryParams, 0, -1);
        }

        $resourceParams = implode('/', $resourceParams);

        if (! empty($resourceParams)) {
            $resourceParams = '/' . $resourceParams;
        }

        if ($absolute) {
            return Request::createFromGlobals()->getSchemeAndHttpHost() .
                $route .
                $resourceParams .
                $queryParams;
        }

        return $route . $resourceParams . $queryParams;
    }
571281
public function getUrl($name, $parameters = [], $schemeRelative = false)
    {
        return $this->generator->generate($name, $parameters, $schemeRelative ? UrlGeneratorInterface::NETWORK_PATH : UrlGeneratorInterface::ABSOLUTE_URL);
    }
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;

	}
973415
public function route($name, $parameters = array(), $absolute = true, $route = null)
    {
        if($path = $this->getPathFinder()->toRouteName($name, $parameters)){
            if($absolute){
                return $this->to($path);
            }
            return $path;
        }

        return parent::route($name, $parameters, $absolute, $route);
    }
1332804
public function getAuthorizationUrl($name, $redirectUrl = null, array $extraParameters = [])
    {
        return $this->helper->getAuthorizationUrl($name, $redirectUrl, $extraParameters);
    }