Regex 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
inherited_from \Zend_Controller_Router_Route_Abstract

 Methods

Constructor

__construct($route, array $defaults = array(), array $map = array(), null $reverse = null

Parameters

$route

$defaults

array

$map

array

$reverse

null

Assembles a URL path defined by this route

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

Parameters

$data

array

An array of name (or index) and value pairs used as parameters

$reset

boolean

$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_Regex
Static

Parameters

$config

\Zend_Config

Configuration object

Returns

\Zend_Controller_Router_Route_Regex

Get partially matched path

getMatchedPath() : string
Inherited

Returns

string

Get all variables which are used by the route

getVariables() : array

Returns

array

Get the version of the route

getVersion() : integer
inherited_from \Zend_Controller_Router_Route_Abstract::getVersion()

Returns

integer

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 a previously defined route.

match(string $path, $partial = false) : array | false

Assigns and returns an array of defaults on a successful match.

Parameters

$path

string

Path used to match against this routing map

$partial

Returns

arrayfalseAn array of assigned values or a false on a mismatch

Set partially matched path

setMatchedPath(string $path) : void
Inherited

Parameters

$path

string

_arrayMergeNumericKeys() - allows for a strict key (numeric's included) array_merge.

_arrayMergeNumericKeys(array $array1, array $array2) : array

php's array_merge() lacks the ability to merge with numeric keys.

Parameters

$array1

array

$array2

array

Returns

array

Maps numerically indexed array values to it's associative mapped counterpart.

_getMappedValues(array $values, boolean $reversed = false, boolean $preserve = false) : array

Or vice versa. Uses user provided map array which consists of index => name parameter mapping. If map is not found, it returns original array.

Method strips destination type of keys form source array. Ie. if source array is indexed numerically then every associative key will be stripped. Vice versa if reversed is set to true.

Parameters

$values

array

Indexed or associative array of values to map

$reversed

boolean

False means translation of index to association. True means reverse.

$preserve

boolean

Should wrong type of keys be preserved or stripped.

Returns

arrayAn array of mapped values

 Properties

 

Default values for the route (ie. module, controller, action, params)

$_defaults : array

Default

array()
 

Wether this route is abstract or not

$_isAbstract : boolean

Default

false
 

Map

$_map : array

Default

array()
 

Path matched by this route

$_matchedPath : string

Default

null
 

Regex string

$_regex : string | null

Default

null
 

Reverse

$_reverse : string | null

Default

null
 

Values

$_values : array

Default

array()

 Constants

 

URI delimiter

URI_DELIMITER = '/'