Rest Route

Request-aware route for RESTful modular routing

category Zend
package Zend_Rest
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License
inherited_from \Zend_Controller_Router_Route_Module

 Methods

Constructor

__construct(\Zend_Controller_Front $front, array $defaults = array(), array $responders = array()
inherited_from \Zend_Controller_Router_Route_Module::__construct()

Parameters

$front

\Zend_Controller_Front

Front Controller object

$defaults

array

Defaults for map variables with keys as variable names

$responders

array

Modules or controllers to receive RESTful routes

Constructor

__construct(array $defaults = array(), \Zend_Controller_Dispatcher_Interface $dispatcher = null, \Zend_Controller_Request_Abstract $request = null
Inherited

Parameters

$defaults

array

Defaults for map variables with keys as variable names

$dispatcher

\Zend_Controller_Dispatcher_Interface

Dispatcher object

$request

\Zend_Controller_Request_Abstract

Request object

Assembles user submitted parameters forming a URL path defined by this route

assemble(array $data = array(), boolean $reset = false, boolean $encode = true) : string
inherited_from \Zend_Controller_Router_Route_Module::assemble()

Parameters

$data

array

An array of variable and value pairs used as parameters

$reset

boolean

Weither to reset the current params

$encode

boolean

Weither to return urlencoded string

Returns

stringRoute path with user submitted parameters

Assembles user submitted parameters forming a URL path defined by this route

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

Parameters

$data

array

An array of variable and value pairs used as parameters

$reset

boolean

Weither to reset the current params

$encode

boolean

$partial

boolean

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
Inherited

Parameters

$name

string

Array key of the parameter

Returns

stringPreviously set default

Return an array of defaults

getDefaults() : array
Inherited

Returns

arrayRoute defaults

Instantiates route based on passed Zend_Config structure

getInstance(\Zend_Config $config) 
Static
inherited_from \Zend_Controller_Router_Route_Module::getInstance()

Parameters

$config

Instantiates route based on passed Zend_Config structure

getInstance(\Zend_Config $config) : \Zend_Controller_Router_Route_Module
InheritedStatic

Parameters

$config

\Zend_Config

Returns

\Zend_Controller_Router_Route_Module

Get partially matched path

getMatchedPath() : string
Inherited

Returns

string

Tells Rewrite Router which version this Route is

getVersion() : integer
inherited_from \Zend_Controller_Router_Route_Module::getVersion()

Returns

integerRoute "version"

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 request. Assigns and returns an array of variables on a successful match.

match(\Zend_Controller_Request_Http $request, boolean $partial = false) : array

If a request object is registered, it uses its setModuleName(), setControllerName(), and setActionName() accessors to set those values. Always returns the values as an array.

inherited_from \Zend_Controller_Router_Route_Module::match()

Parameters

$request

\Zend_Controller_Request_Http

Request used to match against this routing ruleset

$partial

Returns

arrayAn array of assigned values or a false on a mismatch

Matches a user submitted path. Assigns and returns an array of variables on a successful match.

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

If a request object is registered, it uses its setModuleName(), setControllerName(), and setActionName() accessors to set those values. Always returns the values as an array.

Parameters

$path

string

Path used to match against this routing map

$partial

boolean

Returns

arrayAn array of assigned values or a false on a mismatch

Set partially matched path

setMatchedPath(string $path) : void
Inherited

Parameters

$path

string

Determines if RESTful routing applies to the entire app

_allRestful() : boolean

Returns

boolean

Determine if a specified module + controller combination supports RESTful routing

_checkRestfulController(string $moduleName, string $controllerName) : boolean

Parameters

$moduleName

string

$controllerName

string

Returns

boolean

Determine if a specified module supports RESTful routing

_checkRestfulModule(string $moduleName) : boolean

Parameters

$moduleName

string

Returns

boolean

Determines if RESTful routing applies to an entire module

_fullRestfulModule(string $moduleName) : boolean

Parameters

$moduleName

string

Returns

boolean

Parses the responders array sent to constructor to know which modules and/or controllers are RESTful

_parseResponders(array $responders) 

Parameters

$responders

array

Set request keys based on values in request object

_setRequestKeys() : void
Inherited

 Properties

 

$_actionKey

$_actionKey 

Default

'action'
 

$_controllerKey

$_controllerKey 

Default

'controller'
 

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

$_defaults : array

Default

 

$_dispatcher

$_dispatcher : \Zend_Controller_Dispatcher_Interface

Default

 

$_front

$_front : \Zend_Controller_Front

Default

 

Wether this route is abstract or not

$_isAbstract : boolean

Default

false
 

$_keysSet

$_keysSet : boolean

Default

false
 

Path matched by this route

$_matchedPath : string

Default

null
 

$_moduleKey

$_moduleKey 

Default

'module'
 

$_moduleValid

$_moduleValid : boolean

Default

false
 

$_request

$_request : \Zend_Controller_Request_Abstract

Default

 

Specific Modules=>Controllers to receive RESTful routes

$_restfulControllers : array

Default

null
 

Specific Modules to receive RESTful routes

$_restfulModules : array

Default

null
 

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

$_values : array

Default

array()

 Constants

 

URI delimiter

URI_DELIMITER = '/'