URI Factory Class

The URI factory can be used to generate URI objects from strings, using a different URI subclass depending on the input URI scheme. New scheme-specific classes can be registered using the registerScheme() method.

Note that this class contains only static methods and should not be instantiated

package Default

 Methods

Create a URI from a string

factory(string $uriString, string $defaultScheme = null) : \Zend\Uri\Uri
Static

Parameters

$uriString

string

$defaultScheme

string

Exceptions

\Zend\Uri\Exception\InvalidArgumentException

Returns

\Zend\Uri\Uri

Get the class name for a registered scheme

getRegisteredSchemeClass(string $scheme) : string | null
Static

If provided scheme is not registered, will return NULL

Parameters

$scheme

string

Returns

stringnull

Register a scheme-specific class to be used

registerScheme(string $scheme, string $class) 
Static

Parameters

$scheme

string

$class

string

Unregister a scheme

unregisterScheme(string $scheme) 
Static

Parameters

$scheme

string

 Properties

 

Registered scheme-specific classes

$schemeClasses : array

Default

array('http' => 'Zend\Uri\Http', 'https' => 'Zend\Uri\Http', 'mailto' => 'Zend\Uri\Mailto', 'file' => 'Zend\Uri\File', 'urn' => 'Zend\Uri\Uri', 'tag' => 'Zend\Uri\Uri')
Static