Ruby routing based Router.
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_Abstract |
__construct(array $params = array()
)
array
addConfig(\Zend_Config $config, string $section = null
) : \Zend_Controller_Router_Rewrite
Example INI: routes.archive.route = "archive/:year/*" routes.archive.defaults.controller = archive routes.archive.defaults.action = show routes.archive.defaults.year = 2000 routes.archive.reqs.year = "\d+"
routes.news.type = "Zend_Controller_Router_Route_Static" routes.news.route = "news" routes.news.defaults.controller = "news" routes.news.defaults.action = "list"
And finally after you have created a Zend_Config with above ini: $router = new Zend_Controller_Router_Rewrite(); $router->addConfig($config, 'routes');
\Zend_Config
Configuration object
string
Name of the config section containing route's definitions
\Zend_Controller_Router_Exception |
---|
\Zend_Controller_Router_Rewrite
addDefaultRoutes() : \Zend_Controller_Router_Rewrite
\Zend_Controller_Router_Rewrite
addRoute(string $name, \Zend_Controller_Router_Route_Interface $route) : \Zend_Controller_Router_Rewrite
If route contains method setRequest(), it is initialized with a request object
string
Name of the route
\Zend_Controller_Router_Route_Interface
Instance of the route
\Zend_Controller_Router_Rewrite
addRoutes(array $routes) : \Zend_Controller_Router_Rewrite
array
Array of routes with names as keys and routes as values
\Zend_Controller_Router_Rewrite
assemble(array $userParams, mixed $name= null
, boolean $reset= false
, boolean $encode= true
) : string
array
Options passed by a user used to override parameters
mixed
The name of a Route to use
boolean
Whether to reset to the route defaults ignoring URL params
boolean
Tells to encode URL parts on output
\Zend_Controller_Router_Exception |
---|
string
Resulting absolute URL pathclearParams($name = null
) : \Zend_Controller_Router_Abstract
By default, clears all parameters. If a parameter name is given, clears only that parameter; if an array of parameter names is provided, clears each.
inherited_from | \Zend_Controller_Router_Interface::clearParams() |
---|
\Zend_Controller_Router_Abstract
getChainNameSeparator() : string
string
getCurrentRoute() : \Zend_Controller_Router_Route_Interface
\Zend_Controller_Router_Exception |
---|
\Zend_Controller_Router_Route_Interface
Route objectgetCurrentRouteName() : string
\Zend_Controller_Router_Exception |
---|
string
Route namegetFrontController() : \Zend_Controller_Front
inherited_from | \Zend_Controller_Router_Interface::getFrontController() |
---|
\Zend_Controller_Front
getParam(string $name) : mixed
inherited_from | \Zend_Controller_Router_Interface::getParam() |
---|
string
mixed
getParams() : array
inherited_from | \Zend_Controller_Router_Interface::getParams() |
---|
array
getRoute(string $name) : \Zend_Controller_Router_Route_Interface
string
Name of the route
\Zend_Controller_Router_Exception |
---|
\Zend_Controller_Router_Route_Interface
Route objectgetRoutes() : array
array
All of the defined routeshasRoute(string $name) : boolean
string
Name of the route
boolean
removeDefaultRoutes() : \Zend_Controller_Router_Rewrite
\Zend_Controller_Router_Rewrite
removeRoute(string $name) : \Zend_Controller_Router_Rewrite
string
Name of the route
\Zend_Controller_Router_Exception |
---|
\Zend_Controller_Router_Rewrite
route(\Zend_Controller_Request_Abstract $request) : \Zend_Controller_Request_Abstract
\Zend_Controller_Request_Abstract
\Zend_Controller_Router_Exception |
---|
\Zend_Controller_Request_Abstract
Request objectsetChainNameSeparator(string $separator) : \Zend_Controller_Router_Rewrite
string
The separator to use
\Zend_Controller_Router_Rewrite
setFrontController(\Zend_Controller_Front $controller) : \Zend_Controller_Router_Interface
inherited_from | \Zend_Controller_Router_Interface::setFrontController() |
---|
\Zend_Controller_Front
\Zend_Controller_Router_Interface
setGlobalParam(string $name, mixed $value) : \Zend_Controller_Router_Rewrite
string
mixed
\Zend_Controller_Router_Rewrite
setParam(string $name, mixed $value) : \Zend_Controller_Router_Abstract
inherited_from | \Zend_Controller_Router_Interface::setParam() |
---|
string
mixed
\Zend_Controller_Router_Abstract
setParams(array $params) : \Zend_Controller_Router_Abstract
inherited_from | \Zend_Controller_Router_Interface::setParams() |
---|
array
\Zend_Controller_Router_Abstract
useRequestParametersAsGlobal(boolean|null $use = null
) : boolean | \Zend_Controller_Router_Rewrite
boolean
null
Null/unset when you want to retrieve the current state. True when request parameters should be global, false otherwise
boolean
\Zend_Controller_Router_Rewrite
Returns a boolean if first param isn't set, returns an
instance of Zend_Controller_Router_Rewrite otherwise._addChainRoutesFromConfig(string $name, \Zend_Controller_Router_Route_Interface $route, \Zend_Config $childRoutesInfo) : void
string
\Zend_Controller_Router_Route_Interface
\Zend_Config
_getRouteFromConfig(\Zend_Config $info) : \Zend_Controller_Router_Route_Interface
\Zend_Config
\Zend_Controller_Router_Route_Interface
_setRequestParams(\Zend_Controller_Request_Abstract $request, array $params)
Module name, controller name and action name
\Zend_Controller_Request_Abstract
array
$_chainNameSeparator : string
'-'
$_currentRoute : string
null
$_frontController : \Zend_Controller_Front
$_globalParams : array
array()
$_invokeParams : array
array()
$_routes : array
array()
$_useCurrentParamsAsGlobal : boolean
false
$_useDefaultRoutes : boolean
true
URI_DELIMITER = '/'