1959. Function

1959.1. Zend\Uri\__construct

ZendUri__construct()

Create a new URI object

Parameters:Uri|string|null
Throws ExceptionInvalidArgumentException:
 

1960. Function

1960.1. Zend\Uri\isValid

ZendUriisValid()

Check if the URI is valid

Note that a relative URI may still be valid

Return type:bool

1961. Function

1961.1. Zend\Uri\isValidRelative

ZendUriisValidRelative()

Check if the URI is a valid relative URI

Return type:bool

1962. Function

1962.1. Zend\Uri\isAbsolute

ZendUriisAbsolute()

Check if the URI is an absolute or relative URI

Return type:bool

1963. Function

1963.1. Zend\Uri\parse

ZendUriparse()

Parse a URI string

Parameters:string
Return type:Uri

1964. Function

1964.1. Zend\Uri\toString

ZendUritoString()

Compose the URI into a string

Return type:string
Throws :ExceptionInvalidUriException

1965. Function

1965.1. Zend\Uri\normalize

ZendUrinormalize()

Normalize the 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

Return type:Uri

1966. Function

1966.1. Zend\Uri\makeRelative

ZendUrimakeRelative()

Convert the link to a relative link by substracting a base 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.

Parameters:Uri|string
Return type:Uri

1967. Function

1967.1. Zend\Uri\getScheme

ZendUrigetScheme()

Get the scheme part of the URI

Return type:string|null

1968. Function

1968.1. Zend\Uri\getUserInfo

ZendUrigetUserInfo()

Get the User-info (usually user:password) part

Return type:string|null

1969. Function

1969.1. Zend\Uri\getHost

ZendUrigetHost()

Get the URI host

Return type:string|null

1970. Function

1970.1. Zend\Uri\getPort

ZendUrigetPort()

Get the URI port

Return type:integer|null

1971. Function

1971.1. Zend\Uri\getPath

ZendUrigetPath()

Get the URI path

Return type:string|null

1972. Function

1972.1. Zend\Uri\getQuery

ZendUrigetQuery()

Get the URI query

Return type:string|null

1973. Function

1973.1. Zend\Uri\getQueryAsArray

ZendUrigetQueryAsArray()

Return the query string as an associative array of key => value pairs

This is an extension to RFC-3986 but is quite useful when working with most common URI types

Return type:array

1974. Function

1974.1. Zend\Uri\getFragment

ZendUrigetFragment()

Get the URI fragment

Return type:string|null

1975. Function

1975.1. Zend\Uri\setScheme

ZendUrisetScheme()

Set the URI scheme

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 ZendUriHttp class) an exception will be thrown.

You can check if a scheme is valid before setting it using the validateScheme() method.

Parameters:string
Throws ExceptionInvalidUriPartException:
 
Return type:Uri

1976. Function

1976.1. Zend\Uri\setUserInfo

ZendUrisetUserInfo()

Set the URI User-info part (usually user:password)

Parameters:string
Return type:Uri
Throws :ExceptionInvalidUriPartException If the schema definition

does not have this part

1977. Function

1977.1. Zend\Uri\setHost

ZendUrisetHost()

Set the URI host

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.

Parameters:string
Throws ExceptionInvalidUriPartException:
 
Return type:Uri

1978. Function

1978.1. Zend\Uri\setPort

ZendUrisetPort()

Set the port part of the URI

Parameters:integer
Return type:Uri

1979. Function

1979.1. Zend\Uri\setPath

ZendUrisetPath()

Set the path

Parameters:string
Return type:Uri

1980. Function

1980.1. Zend\Uri\setQuery

ZendUrisetQuery()

Set the query string

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.

Parameters:string|array
Return type:Uri

1981. Function

1981.1. Zend\Uri\setFragment

ZendUrisetFragment()

Set the URI fragment part

Parameters:string
Return type:Uri
Throws :ExceptionInvalidUriPartException If the schema definition

does not have this part

1982. Function

1982.1. Zend\Uri\__toString

ZendUri__toString()

Magic method to convert the URI to a string

Return type:string