__construct()
__toString()
getFragment()
getHost()
getPath()
getPort()
getQuery()
getQueryAsArray()
getScheme()
getUserInfo()
isAbsolute()
isValid()
isValidRelative()
makeRelative()
normalize()
parse()
setFragment()
setHost()
setPath()
setPort()
setQuery()
setScheme()
setUserInfo()
toString()
Interface defining a URI
__toString() : string
string
getFragment() : string | null
string
null
getHost() : string | null
string
null
getPath() : string | null
string
null
getPort() : int | null
int
null
getQuery() : string | null
string
null
getQueryAsArray() : array
This is an extension to RFC-3986 but is quite useful when working with most common URI types
array
getScheme() : string | null
string
null
getUserInfo() : string | null
string
null
isAbsolute() : bool
bool
isValid() : bool
Note that a relative URI may still be valid
bool
isValidRelative() : bool
bool
makeRelative(\Zend\Uri\Uri | string $baseUri) : \Zend\Uri\Uri
This is the opposite of resolving a relative link - i.e. creating a relative reference link from an original URI and a base URI.
If the two URIs do not intersect (e.g. the original URI is not in any way related to the base URI) the URI will not be modified.
\Zend\Uri\Uristring
normalize() : \Zend\Uri\Uri
Normalizing a URI includes removing any redundant parent directory or current directory references from the path (e.g. foo/bar/../baz becomes foo/baz), normalizing the scheme case, decoding any over-encoded characters etc.
Eventually, two normalized URLs pointing to the same resource should be equal even if they were originally represented by two different strings
setFragment(string $fragment) : \Zend\Uri\Uri
string
\Zend\Uri\Exception\InvalidUriPartException |
If the schema definition does not have this part |
---|
setHost(string $host) : \Zend\Uri\Uri
Note that the generic syntax for URIs allows using host names which are not necessarily IPv4 addresses or valid DNS host names. For example, IPv6 addresses are allowed as well, and also an abstract "registered name" which may be any name composed of a valid set of characters, including, for example, tilda (~) and underscore (_) which are not allowed in DNS names.
Subclasses of Uri may impose more strict validation of host names - for example the HTTP RFC clearly states that only IPv4 and valid DNS names are allowed in HTTP URIs.
string
\Zend\Uri\Exception\InvalidUriPartException |
---|
setQuery(string | array $query) : \Zend\Uri\Uri
If an array is provided, will encode this array of parameters into a query string. Array values will be represented in the query string using PHP's common square bracket notation.
stringarray
setScheme(string $scheme) : \Zend\Uri\Uri
If the scheme is not valid according to the generic scheme syntax or is not acceptable by the specific URI class (e.g. 'http' or 'https' are the only acceptable schemes for the Zend\Uri\Http class) an exception will be thrown.
You can check if a scheme is valid before setting it using the validateScheme() method.
string
\Zend\Uri\Exception\InvalidUriPartException |
---|
setUserInfo(string $userInfo) : \Zend\Uri\Uri
string
\Zend\Uri\Exception\InvalidUriPartException |
If the schema definition does not have this part |
---|
toString() : string