english/libraries/joomla/methods.php
/**
	 * Translates an internal Joomla URL to a humanly readible URL.
	 *
	 * @param   string   $url    Absolute or Relative URI to Joomla resource.
	 * @param   boolean  $xhtml  Replace & by &amp; for XML compilance.
	 * @param   integer  $ssl    Secure state for the resolved URI.
	 *                             1: Make URI secure using global secure site URI.
	 *                             0: Leave URI in the same secure state as it was passed to the function.
	 *                            -1: Make URI unsecure using the global unsecure site URI.
	 *
	 * @return  The translated humanly readible URL.
	 * @since   11.1
	 */
Translates an internal Joomla URL to a humanly readible URL.
@param   string   $url    Absolute or Relative URI to Joomla resource.
@param   boolean  $xhtml  Replace & by & for XML compilance.
@param   integer  $ssl    Secure state for the resolved URI.
1: Make URI secure using global secure site URI.
0: Leave URI in the same secure state as it was passed to the function.
-1: Make URI unsecure using the global unsecure site URI.

@return  The translated humanly readible URL.
Translates an internal Joomla URL to a humanly readible URL . @param string $url Absolute or Relative URI to Joomla resource . @param boolean $xhtml Replace & by & for XML compilance . @param integer $ssl Secure state for the resolved URI . 1 : Make URI secure using global secure site URI . 0 : Leave URI in the same secure state as it was passed to the function . - 1 : Make URI unsecure using the global unsecure site URI . @return The translated humanly readible URL .
public static function _($url, $xhtml = true, $ssl = null)
	{
		$app	= JFactory::getApplication();
		$router	= $app->getRouter();
		if (!$router) {
			return null;
		}
		if ((strpos($url, '&') !== 0) && (strpos($url, 'index.php') !== 0)) {
			return $url;
		}
		$uri = $router->build($url);
		$url = $uri->toString(array('path', 'query', 'fragment'));
		$url = preg_replace('/\s/u', '%20', $url);
		if ((int) $ssl) {
			$uri = JURI::getInstance();
			static $prefix;
			if (!$prefix) {
				$prefix = $uri->toString(array('host', 'port'));
			}
			$scheme	= ((int)$ssl === 1) ? 'https' : 'http';
			if (!preg_match('#^/#', $url)) {
				$url = '/'.$url;
			}
			$url = $scheme.'://'.$prefix.$url;
		}
		if ($xhtml) {
			$url = htmlspecialchars($url);
		}
		return $url;
	}
public static function _ ( $ url , $ xhtml = true , $ ssl = null ) { $ app = JFactory :: getApplication ( ) ; $ router = $ app -> getRouter ( ) ; if ( ! $ router ) { return null ; } if ( ( strpos ( $ url , '&' ) !== 0 ) && ( strpos ( $ url , 'index.php' ) !== 0 ) ) { return $ url ; } $ uri = $ router -> build ( $ url ) ; $ url = $ uri -> toString ( array ( 'path' , 'query' , 'fragment' ) ) ; $ url = preg_replace ( '/\s/u' , '%20' , $ url ) ; if ( ( int ) $ ssl ) { $ uri = JURI :: getInstance ( ) ; static $ prefix ; if ( ! $ prefix ) { $ prefix = $ uri -> toString ( array ( 'host' , 'port' ) ) ; } $ scheme = ( ( int ) $ ssl === 1 ) ? 'https' : 'http' ; if ( ! preg_match ( '#^/#' , $ url ) ) { $ url = '/' . $ url ; } $ url = $ scheme . '://' . $ prefix . $ url ; } if ( $ xhtml ) { $ url = htmlspecialchars ( $ url ) ; } return $ url ; }
Translates an internal Joomla URL to a humanly readible URL.
Translates an internal Joomla URL to a humanly readible URL .
// Get the router. // Make sure that we have our router // Build route. // Replace spaces. /*
		 * Get the secure/unsecure URLs.
		 *
		 * If the first 5 characters of the BASE are 'https', then we are on an ssl connection over
		 * https and need to set our secure URL to the current request URL, if not, and the scheme is
		 * 'http', then we need to do a quick string manipulation to switch schemes.
		 */ // Get additional parts. // Determine which scheme we want. // Make sure our URL path begins with a slash. // Build the URL.