interface UriInterface (View source)

Uri Interface

Interface for read-only access to Uris. This class is a fork from Joomla Uri.

Methods

string
__toString()

Magic method to get the string representation of the URI object.

string
toString(array $parts = array('scheme', 'user', 'pass', 'host', 'port', 'path', 'query', 'fragment'))

Returns full uri string.

boolean
hasVar(string $name)

Checks if variable exists.

array
getVar(string $name, string $default = null)

Returns a query variable by name.

string
getQuery(boolean $toArray = false)

Returns flat query string.

string
getScheme()

Get URI scheme (protocol) ie. http, https, ftp, etc.

string
getUser()

Get URI username Returns the username, or null if no username was specified.

string
getPass()

Get URI password Returns the password, or null if no password was specified.

string
getHost()

Get URI host Returns the hostname/ip or null if no hostname/ip was specified.

integer
getPort()

Get URI port Returns the port number, or null if no port was specified.

string
getPath()

Gets the URI path string.

string
getFragment()

Get the URI archor string Everything after the "#".

boolean
isSSL()

Checks whether the current URI is using HTTPS.

Details

at line line 27
string __toString()

Magic method to get the string representation of the URI object.

Return Value

string

at line line 38
string toString(array $parts = array('scheme', 'user', 'pass', 'host', 'port', 'path', 'query', 'fragment'))

Returns full uri string.

Parameters

array $parts An array specifying the parts to render.

Return Value

string The rendered URI string.

at line line 49
boolean hasVar(string $name)

Checks if variable exists.

Parameters

string $name Name of the query variable to check.

Return Value

boolean True if the variable exists.

at line line 61
array getVar(string $name, string $default = null)

Returns a query variable by name.

Parameters

string $name Name of the query variable to get.
string $default Default value to return if the variable is not set.

Return Value

array Query variables.

at line line 72
string getQuery(boolean $toArray = false)

Returns flat query string.

Parameters

boolean $toArray True to return the query as a key => value pair array.

Return Value

string Query string.

at line line 82
string getScheme()

Get URI scheme (protocol) ie. http, https, ftp, etc.

..

Return Value

string The URI scheme.

at line line 92
string getUser()

Get URI username Returns the username, or null if no username was specified.

Return Value

string The URI username.

at line line 102
string getPass()

Get URI password Returns the password, or null if no password was specified.

Return Value

string The URI password.

at line line 112
string getHost()

Get URI host Returns the hostname/ip or null if no hostname/ip was specified.

Return Value

string The URI host.

at line line 122
integer getPort()

Get URI port Returns the port number, or null if no port was specified.

Return Value

integer The URI port number.

at line line 131
string getPath()

Gets the URI path string.

Return Value

string The URI path string.

at line line 141
string getFragment()

Get the URI archor string Everything after the "#".

Return Value

string The URI anchor string.

at line line 150
boolean isSSL()

Checks whether the current URI is using HTTPS.

Return Value

boolean True if using SSL via HTTPS.