Generate a URL for the given route.

@param  \Illuminate\Routing\Route  $route
@param  array  $parameters
@param  bool  $absolute
@return string

@throws \Illuminate\Routing\Exceptions\UrlGenerationException
186097
public function to($route, $parameters = [], $absolute = false)
    {
        $domain = $this->getRouteDomain($route, $parameters);

        // First we will construct the entire URI including the root and query string. Once it
        // has been constructed, we'll make sure we don't have any missing parameters or we
        // will need to throw the exception to let the developers know one was not given.
        $uri = $this->addQueryString($this->url->format(
            $root = $this->replaceRootParameters($route, $domain, $parameters),
            $this->replaceRouteParameters($route->uri(), $parameters),
            $route
        ), $parameters);

        if (preg_match('/\{.*?\}/', $uri)) {
            throw UrlGenerationException::forMissingParameters($route);
        }

        // Once we have ensured that there are no missing parameters in the URI we will encode
        // the URI and prepare it for returning to the developer. If the URI is supposed to
        // be absolute, we will return it as-is. Otherwise we will remove the URL's root.
        $uri = strtr(rawurlencode($uri), $this->dontEncode);

        if (! $absolute) {
            $uri = preg_replace('#^(//|[^/?])+#', '', $uri);

            if ($base = $this->request->getBaseUrl()) {
                $uri = preg_replace('#^'.$base.'#i', '', $uri);
            }

            return '/'.ltrim($uri, '/');
        }

        return $uri;
    }
925009
protected function getUrl($route, array $parameters = [], $useRequest = false)
    {
        $router = $this->getContext()->getComponent()->getRouter();

        if ($useRequest) {
            $request = $this->getContext()->getRequest();

            $parameters += $request->getParams(IComponentRequest::ROUTE)->toArray();
        }

        return $router->assemble($route, $parameters) ?: '/';
    }
953215
public function getCropEndpoint(
        $endpoint,
        $parameters = array(),
        $absolute = UrlGeneratorInterface::ABSOLUTE_PATH
    ) {
        $parameters = array_merge($parameters, array('endpoint' => $endpoint));

        return $this->router->generate($this->routeName, $parameters, $absolute);
    }
309922
public function route($absolute = false, $domain = false)
    {
        return ($absolute ? $this->rootUrl($domain) : '') . '/' . implode('/', $this->paths);
    }
549388
public function generateUrl(array $routeParameters = []): string
    {
        $url = $this->getUrl();
        $url = \preg_replace('/\{(\w+?):(.+?)\}/', '{$1}', $url);
        foreach ($routeParameters as $parameter => $value) {
            $url = \str_replace('{' . $parameter . '}', $value, $url);
        }

        return $url;
    }
516620
public static function route( $name, $parameters = [], $absolute = true )
	{
		return static::__do( __FUNCTION__, args_with_keys( func_get_args(), __CLASS__, __FUNCTION__ ) );
	}
206242
public function action($action, $parameters = array(), $absolute = true)
    {
        return $this->route($action, $parameters, $absolute, $this->routes->getByAction($action));
    }
902037
public function createUrl( $route, $params = [ ], $absolute = FALSE )
    {
        return $this[ 'request' ]->createUrl( $route, $params, $absolute );
    }
1271853
public function objectUrl($code, $action, $object, $parameters = [], $absolute = UrlGeneratorInterface::ABSOLUTE_PATH)
    {
        list($action, $code) = $this->getCodeAction($code, $action);

        return $this->getAdminPool()->getAdminByAdminCode($code)->generateObjectUrl($action, $object, $parameters, $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);
        }
    }
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
        );
    }
702342
protected function formatDomain($route, &$parameters)
    {
        return $this->addPortToDomain(
            $this->getRouteScheme($route).$route->getDomain()
        );
    }
1358055
public static function toRoute(string $name, string $text, $parameters = [], $absolute = true)
    {
        return static::to(route($name, $parameters, $absolute), $text);
    }
36705
protected function generateLoc($hostWithScheme, $route, $parameters = [])
    {
        if (null === $this->router) {
            throw new \RuntimeException('UrlGenerator interface is missing');
        }

        list($scheme, $host) = explode('://', $hostWithScheme);

        $this->router
            ->getContext()
            ->setHost($host)
            ->setScheme($scheme);

        return $this->router->generate($route, $parameters, UrlGeneratorInterface::ABSOLUTE_URL);
    }
39628
protected function getAbsoluteUrl($route, array $parameters = [], $useRequest = false)
    {
        $request = $this->getContext()->getRequest();

        return $request->getScheme() . '://' . $request->getHost() . $this->getUrl($route, $parameters, $useRequest);
    }
192071
public function printUrl($route)
    {
        if (empty($route)) {
            return '';
        }

        try {
            $url = $this
                ->urlGenerator
                ->generate($route);
        } catch (ExceptionInterface $e) {
            $url = (string) $route;
        }

        return $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);
    }