core/Route/Url.php
public function makeContextUrl( Context $context, $path = '', array $query = [] ): string
	{
		if( $context->isHost() )
		{
			$url  = $context->isSsl() ? "https://" : "http://";
			$url .= $context->getHost();
			$port = $context->getPort();
			if( $port > 0 && $port !== 80 )
			{
				$url .= ":" . $port;
			}
			$url .= $this->isBasePrefix() ? $this->base_prefix : "/";
		}
		else
		{
			$url = $this->getPrefix();
		}

		if( $context->isQuery() )
		{
			foreach($context->getQuery() as $name => $value)
			{
				if( is_array($value) )
				{
					if( ! isset($query[$name]) || ! in_array($query[$name], $value) )
					{
						$query[$name] = current($value);
					}
				}
				else
				{
					$query[$name] = $value;
				}
			}
		}

		if( is_array($path) )
		{
			$path = implode("/", $path);
		}
		else if( strlen($path) && $path[0] === "/" )
		{
			$path = substr($path, 1);
		}

		if( $context->isPath() )
		{
			$path = trim($context->getPath(), "/") . "/" . $path;
		}

		return $this->getModeUrl($url, $path, $query);
	}
public function makeContextUrl( Context $context, $path = '', array $query = [] ): string
	{
		if( $context->isHost() )
		{
			$url  = $context->isSsl() ? "https://" : "http://";
			$url .= $context->getHost();
			$port = $context->getPort();
			if( $port > 0 && $port !== 80 )
			{
				$url .= ":" . $port;
			}
			$url .= $this->isBasePrefix() ? $this->base_prefix : "/";
		}
		else
		{
			$url = $this->getPrefix();
		}

		if( $context->isQuery() )
		{
			foreach($context->getQuery() as $name => $value)
			{
				if( is_array($value) )
				{
					if( ! isset($query[$name]) || ! in_array($query[$name], $value) )
					{
						$query[$name] = current($value);
					}
				}
				else
				{
					$query[$name] = $value;
				}
			}
		}

		if( is_array($path) )
		{
			$path = implode("/", $path);
		}
		else if( strlen($path) && $path[0] === "/" )
		{
			$path = substr($path, 1);
		}

		if( $context->isPath() )
		{
			$path = trim($context->getPath(), "/") . "/" . $path;
		}

		return $this->getModeUrl($url, $path, $query);
	}
public function makeContextUrl ( Context $ context , $ path = '' , array $ query = [ ] ) : string { if ( $ context -> isHost ( ) ) { $ url = $ context -> isSsl ( ) ? "https://" : "http://" ; $ url .= $ context -> getHost ( ) ; $ port = $ context -> getPort ( ) ; if ( $ port > 0 && $ port !== 80 ) { $ url .= ":" . $ port ; } $ url .= $ this -> isBasePrefix ( ) ? $ this -> base_prefix : "/" ; } else { $ url = $ this -> getPrefix ( ) ; } if ( $ context -> isQuery ( ) ) { foreach ( $ context -> getQuery ( ) as $ name => $ value ) { if ( is_array ( $ value ) ) { if ( ! isset ( $ query [ $ name ] ) || ! in_array ( $ query [ $ name ] , $ value ) ) { $ query [ $ name ] = current ( $ value ) ; } } else { $ query [ $ name ] = $ value ; } } } if ( is_array ( $ path ) ) { $ path = implode ( "/" , $ path ) ; } else if ( strlen ( $ path ) && $ path [ 0 ] === "/" ) { $ path = substr ( $ path , 1 ) ; } if ( $ context -> isPath ( ) ) { $ path = trim ( $ context -> getPath ( ) , "/" ) . "/" . $ path ; } return $ this -> getModeUrl ( $ url , $ path , $ query ) ; }
Get full url scheme string

@param Context $context
@param string $path
@param array $query
@return string
Get full url scheme string