Uri
Extends 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( pathonly = false) :
| since |
1.7.0 |
|---|
Arguments
- pathonly
boolIf false, prepend the scheme, host and port information. Default is false.
Response
stringThe base URI string
buildQuery
Build a query from an array (reverse of the PHP parse_str()).
buildQuery(mixed||string|int params) :
| see | parse_str() |
|---|---|
| since |
1.7.0 |
| note |
The parent method is protected, this exposes it as public for B/C |
Arguments
- params
array<string|int, mixed>The array of key => value pairs to return as a query string.
Response
stringThe resulting query string.
current
Returns the URL for the request, minus the query.
current() :
| since |
1.7.0 |
|---|
Response
string
getInstance
Returns the global Uri object, only creating it if it doesn't already exist.
getInstance( uri = 'SERVER') : \Joomla\CMS\Uri\Uri
| since |
1.7.0 |
|---|
Arguments
- uri
stringThe URI to parse. [optional: if null uses script URI]
Response
UriThe URI object.
isInternal
Checks if the supplied URL is internal
isInternal( url) :
| since |
1.7.0 |
|---|
Arguments
- url
stringThe URL to check.
Response
boolTrue if Internal.
parse
Parse a given URI and populate the class fields.
parse( uri) :
| since |
1.7.0 |
|---|---|
| note |
The parent method is protected, this exposes it as public for B/C |
Arguments
- uri
stringThe URI string to parse.
Response
boolTrue on success.
reset
Method to reset class static members for testing and other various issues.
reset() :
| since |
1.7.0 |
|---|
Response
void
root
Returns the root URI for the request.
root( pathonly = false, path = null) :
| since |
1.7.0 |
|---|
Arguments
- pathonly
boolIf false, prepend the scheme, host and port information. Default is false.- path
stringThe path
Response
stringThe root URI string.
Properties
base
The current calculated base url segments.
| since |
1.7.0 |
|---|
Type(s)
array<string|int, mixed>
root
The current calculated root url segments.
| since |
1.7.0 |
|---|
Type(s)
array<string|int, mixed>
current
The current url.
| since |
1.7.0 |
|---|
Type(s)
string