Uri
Extends \Joomla\Uri\UriUri Class
This class serves two purposes. First it parses a URI and provides a common interface for the Joomla Platform to access and manipulate a URI. Second it obtains the URI of the current executing script from the server regardless of server.
since |
1.7.0 |
---|---|
package |
Joomla CMS |
Methods
base
Returns the base URI for the request.
base(bool pathonly = false) : string
since |
1.7.0 |
---|
Arguments
- pathonly
bool
If false, prepend the scheme, host and port information. Default is false.
Response
string
The base URI string
buildQuery
Build a query from an array (reverse of the PHP parse_str()).
buildQuery(array params) : string
see | \Joomla\CMS\Uri\parse_str() |
---|---|
since |
1.7.0 |
note |
The parent method is protected, this exposes it as public for B/C |
Arguments
- params
array
The array of key => value pairs to return as a query string.
Response
string
The resulting query string.
current
Returns the URL for the request, minus the query.
current() : string
since |
1.7.0 |
---|
Response
string
getInstance
Returns the global Uri object, only creating it if it doesn't already exist.
getInstance(string uri = 'SERVER') : \Joomla\CMS\Uri\Uri
since |
1.7.0 |
---|
Arguments
- uri
string
The URI to parse. [optional: if null uses script URI]
Response
\Joomla\CMS\Uri\Uri
The URI object.
isInternal
Checks if the supplied URL is internal
isInternal(string url) : bool
since |
1.7.0 |
---|
Arguments
- url
string
The URL to check.
Response
bool
True if Internal.
parse
Parse a given URI and populate the class fields.
parse(string uri) : bool
since |
1.7.0 |
---|---|
note |
The parent method is protected, this exposes it as public for B/C |
Arguments
- uri
string
The URI string to parse.
Response
bool
True on success.
reset
Method to reset class static members for testing and other various issues.
reset() : void
since |
1.7.0 |
---|
root
Returns the root URI for the request.
root(bool pathonly = false, string path = null) : string
since |
1.7.0 |
---|
Arguments
- pathonly
bool
If false, prepend the scheme, host and port information. Default is false.- path
string
The path
Response
string
The root URI string.