Back to Uri class

Method current

public static string
current
()
Returns the URL for the request, minus the query.
Returns
  • string
Since
  • 1.7.0
Class: Uri
Project: Joomla

Method current - Source code

/**
 * Returns the URL for the request, minus the query.
 *
 * @return  string
 *
 * @since   1.7.0
 */
public static function current()
{
    // Get the current URL.
    if (empty(static::$current)) {
        $uri = static::getInstance();
        static::$current = $uri->toString(array('scheme', 'host', 'port', 'path'));
    }
    return static::$current;
}