src/Url/Url.php
public static function link($linkParams = null)
	{
		if($linkParams === null){

			$link_params = null;
		}

		elseif(is_array($linkParams)){

			$link_params = join(Registry::getConfig()['url_component_separator'], $linkParams);
		
		}

		else{

			$params = func_get_args();
			$link_params = join(Registry::getConfig()['url_component_separator'], $params);
		}

		//get the server name from global $_SERVER[] array()
		$base  = $_SERVER['SERVER_NAME']; 

		$url = Registry::getUrl();

		//check if there is a uri string
		if ( ! empty($url) ) 
		{
			//prepend installation folder to server name
			$base .= substr($_SERVER['REQUEST_URI'], 0,  strpos($_SERVER['REQUEST_URI'], Registry::getUrl()));

		}
		//there is no query string, 
		else
		{
			//prepend installation folder to server name
			$base .= substr($_SERVER['REQUEST_URI'], 0);

		}

    	//use https if its defined in the $_SERVER global variable
    	$protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != "off") ? "https" : "http";

		//compose the url string
		return $protocol . '://' . $base . $link_params;

	}
public static function link($linkParams = null)
	{
		if($linkParams === null){

			$link_params = null;
		}

		elseif(is_array($linkParams)){

			$link_params = join(Registry::getConfig()['url_component_separator'], $linkParams);
		
		}

		else{

			$params = func_get_args();
			$link_params = join(Registry::getConfig()['url_component_separator'], $params);
		}

		//get the server name from global $_SERVER[] array()
		$base  = $_SERVER['SERVER_NAME']; 

		$url = Registry::getUrl();

		//check if there is a uri string
		if ( ! empty($url) ) 
		{
			//prepend installation folder to server name
			$base .= substr($_SERVER['REQUEST_URI'], 0,  strpos($_SERVER['REQUEST_URI'], Registry::getUrl()));

		}
		//there is no query string, 
		else
		{
			//prepend installation folder to server name
			$base .= substr($_SERVER['REQUEST_URI'], 0);

		}

    	//use https if its defined in the $_SERVER global variable
    	$protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != "off") ? "https" : "http";

		//compose the url string
		return $protocol . '://' . $base . $link_params;

	}
public static function link ( $ linkParams = null ) { if ( $ linkParams === null ) { $ link_params = null ; } elseif ( is_array ( $ linkParams ) ) { $ link_params = join ( Registry :: getConfig ( ) [ 'url_component_separator' ] , $ linkParams ) ; } else { $ params = func_get_args ( ) ; $ link_params = join ( Registry :: getConfig ( ) [ 'url_component_separator' ] , $ params ) ; } //get the server name from global $_SERVER[] array() $ base = $ _SERVER [ 'SERVER_NAME' ] ; $ url = Registry :: getUrl ( ) ; //check if there is a uri string if ( ! empty ( $ url ) ) { //prepend installation folder to server name $ base .= substr ( $ _SERVER [ 'REQUEST_URI' ] , 0 , strpos ( $ _SERVER [ 'REQUEST_URI' ] , Registry :: getUrl ( ) ) ) ; } //there is no query string,  else { //prepend installation folder to server name $ base .= substr ( $ _SERVER [ 'REQUEST_URI' ] , 0 ) ; } //use https if its defined in the $_SERVER global variable $ protocol = ( isset ( $ _SERVER [ 'HTTPS' ] ) && $ _SERVER [ 'HTTPS' ] != "off" ) ? "https" : "http" ; //compose the url string return $ protocol . '://' . $ base . $ link_params ; }
This method returns the url string.
@param mixed $linkParams The params to add to the link to generate
@return string $url the base url for this application
@throws this method does not throw an error
This method returns the url string .