Hostname Route

Implements interface and provides convenience methods

package Zend_Controller
subpackage Router
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License
see
inherited_from \Zend_Controller_Router_Route_Abstract

 Methods

Prepares the route for mapping by splitting (exploding) it to a corresponding atomic parts. These parts are assigned a position which is later used for matching and preparing values.

__construct(string $route, array $defaults = array(), array $reqs = array(), string $scheme = null

Parameters

$route

string

Map used to match with later submitted hostname

$defaults

array

Defaults for map variables with keys as variable names

$reqs

array

Regular expression requirements for variables (keys as variable names)

$scheme

string

Assembles user submitted parameters forming a hostname defined by this route

assemble(array $data = array(), boolean $reset = false, boolean $encode = false, boolean $partial = false) : string

Parameters

$data

array

An array of variable and value pairs used as parameters

$reset

boolean

Whether or not to set route defaults with those provided in $data

$encode

boolean

$partial

boolean

Exceptions

\Zend_Controller_Router_Exception

Returns

stringRoute path with user submitted parameters

Create a new chain

chain(\Zend_Controller_Router_Route_Abstract $route, string $separator = '/') : \Zend_Controller_Router_Route_Chain
Inherited

Parameters

$route

\Zend_Controller_Router_Route_Abstract

$separator

string

Returns

\Zend_Controller_Router_Route_Chain

Return a single parameter of route's defaults

getDefault(string $name) : string

Parameters

$name

string

Array key of the parameter

Returns

stringPreviously set default

Return an array of defaults

getDefaults() : array

Returns

arrayRoute defaults

Instantiates route based on passed Zend_Config structure

getInstance(\Zend_Config $config) : \Zend_Controller_Router_Route_Hostname
Static

Parameters

$config

\Zend_Config

Configuration object

Returns

\Zend_Controller_Router_Route_Hostname

Get partially matched path

getMatchedPath() : string
Inherited

Returns

string

Get the request object

getRequest() : \Zend_Controller_Request_Abstract

Returns

\Zend_Controller_Request_Abstract$request

Get all variables which are used by the route

getVariables() : array

Returns

array

Get the version of the route

getVersion() : integer
Inherited

Returns

integer

Check or set wether this is an abstract route or not

isAbstract(boolean $flag = null) : boolean
Inherited

Parameters

$flag

boolean

Returns

boolean

Matches a user submitted path with parts defined by a map. Assigns and returns an array of variables on a successful match.

match(\Zend_Controller_Request_Http $request) : array | false

Parameters

$request

\Zend_Controller_Request_Http

Request to get the host from

Returns

arrayfalseAn array of assigned values or a false on a mismatch

Set partially matched path

setMatchedPath(string $path) : void
Inherited

Parameters

$path

string

Set the request object

setRequest(\Zend_Controller_Request_Abstract|null $request = null

Parameters

$request

\Zend_Controller_Request_Abstractnull

 Properties

 

Default regex string

$_defaultRegex : string | null

Default

null
 

Holds user submitted default values for route's variables. Name and value pairs.

$_defaults : array

Default

array()
 

Host variable

$_hostVariable : string

Default

':'
 

Wether this route is abstract or not

$_isAbstract : boolean

Default

false
 

Path matched by this route

$_matchedPath : string

Default

null
 

Holds Route patterns for all host parts. In case of a variable it stores it's regex requirement or null. In case of a static part, it holds only it's direct value.

$_parts : array

Default

array()
 

Regex delimiter

$_regexDelimiter : string

Default

'#'
 

Current request object

$_request : \Zend_Controller_Request_Abstract

Default

 

Holds user submitted regular expression patterns for route's variables' values.

$_requirements : array

Default

array()

Name and value pairs.

 

Default scheme

$_scheme : string

Default

null
 

Associative array filled on match() that holds matched path values for given variable names.

$_values : array

Default

array()
 

Holds names of all route's pattern variable names. Array index holds a position in host.

$_variables : array

Default

array()
 

Helper var that holds a count of route pattern's static parts for validation

$_staticCount : integer

Default

0

 Constants

 

URI delimiter

URI_DELIMITER = '/'