Creates route url

@param string $host
@param array  $arguments

@return string
@throws RouteException
326622
public function make($host, array $arguments = [])
    {
        return $host === null ? $this->makeRelative($arguments) : $this->makeAbsolute($host, $arguments);
    }
206325
private static function createRedirectResolver(array $options, string $host): \Closure
    {
        $redirectHeaders = [];
        if (0 < $options['max_redirects']) {
            $redirectHeaders['host'] = $host;
            $redirectHeaders['with_auth'] = $redirectHeaders['no_auth'] = array_filter($options['request_headers'], static function ($h) {
                return 0 !== stripos($h, 'Host:');
            });

            if (isset($options['headers']['authorization']) || isset($options['headers']['cookie'])) {
                $redirectHeaders['no_auth'] = array_filter($options['request_headers'], static function ($h) {
                    return 0 !== stripos($h, 'Authorization:') && 0 !== stripos($h, 'Cookie:');
                });
            }
        }

        return static function ($ch, string $location) use ($redirectHeaders) {
            if ($redirectHeaders && $host = parse_url($location, PHP_URL_HOST)) {
                $requestHeaders = $redirectHeaders['host'] === $host ? $redirectHeaders['with_auth'] : $redirectHeaders['no_auth'];
                curl_setopt($ch, CURLOPT_HTTPHEADER, $requestHeaders);
            }

            $url = self::parseUrl(curl_getinfo($ch, CURLINFO_EFFECTIVE_URL));

            return implode('', self::resolveUrl(self::parseUrl($location), $url));
        };
    }
321581
public static function url(string $name, ?array $parameters = [])
  {
    $url = null;

    foreach (Swish::$routes as $route) {
      if ($route['name'] == $name) {
        $url = $route['pattern'];

        if ($route['required'] > 0 && ($route['required'] == count($parameters))) {
          foreach ($parameters as $name => $parameter) {
            $url = str_replace('{' . $name . '}', $parameter, $url);
          }
        }
      }
    }

    if (str_contains($url, ['{', '}'])) $url = null;

    return $url;
  }
689748
public function generate($routeName, array $parameters = [])
    {
        $route = $this->router->getRoute($routeName);

        $required = $route->getParameterPatterns();
        $missing  = array_diff_key($required, $parameters);

        if (!empty($missing)) {
            $parameters = $this->insertDefaultParameterValues($route, $missing, $parameters);
        }

        return $this->buildPath($route->getPath(), $parameters, array_keys($required));
    }
811915
public function getUrlForHost($host)
    {
        $newUrl = clone $this;
        $newUrl->_fragments['host'] = $host;
        $newUrl->_inputString = $newUrl->__toString();

        return $newUrl;
    }
694746
public function withHost($host)
    {
        $uri = $this->getUri()->withHost($host);

        /** @var static $clone */
        $clone = $this->withUri($uri);

        return $clone;
    }
129105
public function getHost(string $host)
	{
		$host = Host::filter($host);
		return $this->offsetExists($host) ? $this->hosts[$host] : null;
	}
1332698
protected function buildUrl( $parts )
	{
		$url	= new ADT_StringBuffer();
		if( isset( $parts['user'] ) && isset( $parts['pass'] ) && $parts['user'] )
			$url->append( $parts['user'].":".$parts['pass']."@" );
		if( substr( $parts['path'], 0, 1 ) != "/" )
			$parts['path']	= "/".$parts['path'];
		$host	= $parts['host'].( !empty( $parts['port'] ) ? ":".$parts['port'] : "" );
		$url->append( $host.$parts['path'] );
		if( isset( $parts['query'] ) )
			$url->append( "?".$parts['query'] );
		$url	= str_replace( "//", "/", $url->toString() );
		$url	= $parts['scheme']."://".$url;
		return $url;
	}
1240021
protected function constructActionUrl(array $parameters = array())
    {
        switch($this->uriBuildMethod) {
            case self::PLAIN_URL_BUILD_METHOD;
                return $this->baseUrl;
                break;
            case self::ADDS_ON_URL_BUILD_METHOD;
                return $this->replaceAddsOn($this->baseUrl, $parameters);
                break;
            default;
                throw new Exception\BadConfiguredActionException(
                    sprintf('Unknown url build method: %s', $this->uriBuildMethod),
                    $this
                );
                break;
        }
    }
1121645
private function createVariadicUrl($haystack, array $args)
    {
        $varCount = substr_count($haystack, self::ROUTE_PARAM_VAR);
        $argCount = count($args);

        // In case, the length is different
        if ($varCount != $argCount) {
            $difference = abs($argCount - $varCount);

            for ($i = 0; $i < $difference; $i++) {
                array_push($args, self::ROUTE_PARAM_VAR);
            }
        }

        $haystack = str_replace(self::ROUTE_PARAM_VAR, '%s', $haystack);
        return vsprintf($haystack, $args);
    }
522373
protected static function createRouteUrl(
        ContainerInterface $container,
        string $routeName,
        array $placeholders = [],
        array $queryParams = []
    ): string {
        /** @var RouterInterface $router */
        $router = $container->get(RouterInterface::class);

        $hostUri = static::getHostUri($container);
        $url     = $router->get($hostUri, $routeName, $placeholders, $queryParams);

        return $url;
    }
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;
    }
408652
protected function  generateUrl($route,array $parameters){
        return $this->container->get('router')->generate($route, $parameters, Router::ABSOLUTE_URL);
    }
129927
public function show(string $host, array $params = [])
    {
        $path = $this->buildKnownHostsPath($host);

        return $this->get($path, $params);
    }
1175673
private function formatHost(?string $host): ?string
    {
        if (null === $host || '' === $host) {
            return $host;
        }

        if ('[' !== $host[0]) {
            return $this->formatRegisteredName($host);
        }

        return $this->formatIp($host);
    }
458339
protected function generateUrl($name, $parameters = array(), $referenceType = RouterInterface::ABSOLUTE_PATH)
    {
        return $this->router->generate($name, $parameters, $referenceType);
    }
815735
public function setHost($host)
    {
        $this->host = $host;
        if (strpos($host, '/') !== false || strpos($host, '?') !== false) {
            if (strpos($host, 'http') === false) {
                $host = 'https://' . $host;
            }
            $url = parse_url($host);
            $this->host = $url['host'];

            if (isset($url['path'])) {
                $this->setPath($url['path']);
            }

            if (isset($url['query'])) {
                if (!isset($url['path'])) { // for example.org?query=string
                    $this->setPath('/');
                }
                $this->setQuery($url['query']);
            }
        }

        return $this;
    }