UriInterface
Uri Interface
Interface for read-only access to URIs.
| since |
1.0 |
|---|---|
| package |
Joomla Framework |
Methods
__toString
Magic method to get the string representation of the URI object.
__toString() :
| since |
1.0 |
|---|
Response
string
getFragment
Get the URI anchor string
getFragment() :
| since |
1.0 |
|---|
Response
stringThe URI anchor string.
getHost
Get the URI host
getHost() :
| since |
1.0 |
|---|
Response
stringThe hostname/IP or null if no hostname/IP was specified.
getPass
Get the URI password
getPass() :
| since |
1.0 |
|---|
Response
stringThe password, or null if no password was specified.
getPath
Gets the URI path string
getPath() :
| since |
1.0 |
|---|
Response
stringThe URI path string.
getPort
Get the URI port
getPort() :
| since |
1.0 |
|---|
Response
intThe port number, or null if no port was specified.
getQuery
Returns flat query string.
getQuery( toArray = false) : array|string
| since |
1.0 |
|---|
Arguments
- toArray
boolTrue to return the query as a key => value pair array.
Response
array<string|int, mixed>|stringQuery string, optionally as an array.
getScheme
Get the URI scheme (protocol)
getScheme() :
| since |
1.0 |
|---|
Response
stringThe URI scheme.
getUser
Get the URI username
getUser() :
| since |
1.0 |
|---|
Response
stringThe username, or null if no username was specified.
getVar
Returns a query variable by name.
getVar( name, default = null) :
| since |
1.0 |
|---|
Arguments
- name
stringName of the query variable to get.- default
stringDefault value to return if the variable is not set.
Response
mixedRequested query variable if present otherwise the default value.
hasVar
Checks if variable exists.
hasVar( name) :
| since |
1.0 |
|---|
Arguments
- name
stringName of the query variable to check.
Response
boolTrue if the variable exists.
isSsl
Checks whether the current URI is using HTTPS.
isSsl() :
| since |
1.0 |
|---|
Response
boolTrue if using SSL via HTTPS.
toString
Returns full URI string.
toString(mixed||string|int parts = ['scheme', 'user', 'pass', 'host', 'port', 'path', 'query', 'fragment']) :
| since |
1.0 |
|---|
Arguments
- parts
array<string|int, mixed>An array of strings specifying the parts to render.
Response
stringThe rendered URI string.
Constants
SCHEME
Include the scheme (http, https, etc.)
| Value | 1 |
|---|---|
| since |
1.2.0 |
Type(s)
int
USER
Include the user
| Value | 2 |
|---|---|
| since |
1.2.0 |
Type(s)
int
PASS
Include the password
| Value | 4 |
|---|---|
| since |
1.2.0 |
Type(s)
int
HOST
Include the host
| Value | 8 |
|---|---|
| since |
1.2.0 |
Type(s)
int
PORT
Include the port
| Value | 16 |
|---|---|
| since |
1.2.0 |
Type(s)
int
PATH
Include the path
| Value | 32 |
|---|---|
| since |
1.2.0 |
Type(s)
int
QUERY
Include the query string
| Value | 64 |
|---|---|
| since |
1.2.0 |
Type(s)
int
FRAGMENT
Include the fragment
| Value | 128 |
|---|---|
| since |
1.2.0 |
Type(s)
int
ALL
Include all available url parts (scheme, user, pass, host, port, path, query, fragment)
| Value | 255 |
|---|---|
| since |
1.2.0 |
Type(s)
int