JURI
JURI Class
This class serves two purposes. First to parse a URI and provide a common interface for the Joomla Framework to access and manipulate a URI. Second to attain the URI of the current executing script from the server regardless of server.
Located in /joomla/environment/uri.php (line 29)
JObject (Subpackage Base)
![]()
JURI (Subpackage Environment)
string
toString
([array $parts = array('scheme', 'user', 'pass', 'host', 'port', 'path', 'query', 'fragment')])
string
$_fragment
= null (line 92)
Anchor
string
$_host
= null (line 50)
Host
string
$_pass
= null (line 71)
Password
string
$_path
= null (line 78)
Path
integer
$_port
= null (line 57)
Port
string
$_query
= null (line 85)
Query
string
$_scheme
= null (line 43)
Protocol
string
$_uri
= null (line 36)
Original URI
string
$_user
= null (line 64)
Username
array
$_vars
= array () (line 99)
Query variable hash
Inherited Variables
Inherited from JObject
JObject::$_errors
Constructor.
You can pass a URI string to the constructor to initialize a specific URI.
- string $uri: The optional URI string
- JObject::__construct()
- Class constructor, overridden in descendant classes.
Returns the base URI for the request.
- boolean $pathonly: If false, prepend the scheme, host and port information. Default is false.
Build a query from a array (reverse of the PHP parse_str())
- $params
- $akey
Removes an item from the query string variables if it exists
- string $name: Name of variable to remove
Get URI host returns the hostname/ip, or null if no hostname/ip was specified
Returns a reference to a global JURI object, only creating it if it doesn't already exist.
This method must be invoked as:
$uri =& JURI::getInstance([$uri]);
- string $uri: The URI to parse. [optional: if null uses script URI]
Get URI password returns the password, or null if no password was specified
Get URI port returns the port number, or null if no port was specified
Get URI username returns the username, or null if no username was specified
Returns a query variable by name
- string $name: Name of the query variable to get
- $default
Checks if the supplied URL is internal
- string $url: The URL to check
Parse a given URI and populate the class fields
- string $uri: The URI string to parse
Returns the root URI for the request.
- boolean $pathonly: If false, prepend the scheme, host and port information. Default is false.
- $path
Set the URI anchor string everything after the "#"
- string $anchor: The URI anchor string
Set the URI path string
- string $path: The URI path string
Sets the query to a supplied string in format: foo=bar&x=y
- mixed $query: (array|string) $query The query string
Set URI scheme (protocol) ie. http, https, ftp, etc...
- string $scheme: The URI scheme
Adds a query variable and value, replacing the value if it already exists and returning the old value.
- string $name: Name of the query variable to set
- string $value: Value of the query variable
Returns full uri string
- array $parts: An array specifying the parts to render
- JObject::toString()
- Object-to-string conversion.
Inherited Methods
Inherited From JObject
JObject::JObject()
JObject::__construct()
JObject::get()
JObject::getError()
JObject::getErrors()
JObject::getProperties()
JObject::getPublicProperties()
JObject::set()
JObject::setError()
JObject::setProperties()
JObject::toString()





static