Zend Framework
1.12
|
Public Member Functions | |
addDefaultRoutes () | |
Add default routes which are used to mimic basic router behaviour. | |
addRoute ($name, Zend_Controller_Router_Route_Interface $route) | |
Add route to the route chain. | |
addRoutes ($routes) | |
Add routes to the route chain. | |
addConfig (Zend_Config $config, $section=null) | |
Create routes out of Zend_Config configuration. | |
removeRoute ($name) | |
Remove a route from the route chain. | |
removeDefaultRoutes () | |
Remove all standard default routes. | |
hasRoute ($name) | |
Check if named route exists. | |
getRoute ($name) | |
Retrieve a named route. | |
getCurrentRoute () | |
Retrieve a currently matched route. | |
getCurrentRouteName () | |
Retrieve a name of currently matched route. | |
getRoutes () | |
Retrieve an array of routes added to the route chain. | |
route (Zend_Controller_Request_Abstract $request) | |
Find a matching route to the current PATH_INFO and inject returning values to the Request object. | |
assemble ($userParams, $name=null, $reset=false, $encode=true) | |
Generates a URL path that can be used in URL creation, redirection, etc. | |
setGlobalParam ($name, $value) | |
Set a global parameter. | |
setChainNameSeparator ($separator) | |
Set the separator to use with chain names. | |
getChainNameSeparator () | |
Get the separator to use for chain names. | |
useRequestParametersAsGlobal ($use=null) | |
Determines/returns whether to use the request parameters as global parameters. | |
![]() | |
__construct (array $params=array()) | |
Constructor. | |
setParam ($name, $value) | |
Add or modify a parameter to use when instantiating an action controller. | |
setParams (array $params) | |
Set parameters to pass to action controller constructors. | |
getParam ($name) | |
Retrieve a single parameter from the controller parameter stack. | |
getParams () | |
Retrieve action controller instantiation parameters. | |
clearParams ($name=null) | |
Clear the controller parameter stack. | |
getFrontController () | |
Retrieve Front Controller. | |
setFrontController (Zend_Controller_Front $controller) | |
Set Front Controller. | |
Protected Member Functions | |
_getRouteFromConfig (Zend_Config $info) | |
Get a route frm a config instance. | |
_addChainRoutesFromConfig ($name, Zend_Controller_Router_Route_Interface $route, Zend_Config $childRoutesInfo) | |
Add chain routes from a config route. | |
_setRequestParams ($request, $params) | |
Protected Attributes | |
$_useDefaultRoutes = true | |
$_routes = array() | |
$_currentRoute = null | |
$_globalParams = array() | |
$_chainNameSeparator = '-' | |
$_useCurrentParamsAsGlobal = false | |
![]() | |
$_frontController | |
$_invokeParams = array() | |
Additional Inherited Members | |
![]() | |
const | URI_DELIMITER = '/' |
URI delimiter. | |
|
protected |
Add chain routes from a config route.
string | $name | |
Zend_Controller_Router_Route_Interface | $route | |
Zend_Config | $childRoutesInfo |
|
protected |
Get a route frm a config instance.
Zend_Config | $info |
|
protected |
addConfig | ( | Zend_Config | $config, |
$section = null |
|||
) |
Create routes out of Zend_Config configuration.
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 | $config | Configuration object |
string | $section | Name of the config section containing route's definitions |
Zend_Controller_Router_Exception |
addDefaultRoutes | ( | ) |
Add default routes which are used to mimic basic router behaviour.
addRoute | ( | $name, | |
Zend_Controller_Router_Route_Interface | $route | ||
) |
Add route to the route chain.
If route contains method setRequest(), it is initialized with a request object
string | $name | Name of the route |
Zend_Controller_Router_Route_Interface | $route | Instance of the route |
addRoutes | ( | $routes | ) |
Add routes to the route chain.
array | $routes | Array of routes with names as keys and routes as values |
assemble | ( | $userParams, | |
$name = null , |
|||
$reset = false , |
|||
$encode = true |
|||
) |
Generates a URL path that can be used in URL creation, redirection, etc.
array | $userParams | Options passed by a user used to override parameters |
mixed | $name | The name of a Route to use |
bool | $reset | Whether to reset to the route defaults ignoring URL params |
bool | $encode | Tells to encode URL parts on output |
Zend_Controller_Router_Exception |
Implements Zend_Controller_Router_Interface.
getChainNameSeparator | ( | ) |
Get the separator to use for chain names.
getCurrentRoute | ( | ) |
Retrieve a currently matched route.
Zend_Controller_Router_Exception |
getCurrentRouteName | ( | ) |
Retrieve a name of currently matched route.
Zend_Controller_Router_Exception |
getRoute | ( | $name | ) |
Retrieve a named route.
string | $name | Name of the route |
Zend_Controller_Router_Exception |
getRoutes | ( | ) |
Retrieve an array of routes added to the route chain.
hasRoute | ( | $name | ) |
Check if named route exists.
string | $name | Name of the route |
removeDefaultRoutes | ( | ) |
Remove all standard default routes.
Zend_Controller_Router_Route_Interface | Route |
removeRoute | ( | $name | ) |
Remove a route from the route chain.
string | $name | Name of the route |
Zend_Controller_Router_Exception |
route | ( | Zend_Controller_Request_Abstract | $request | ) |
Find a matching route to the current PATH_INFO and inject returning values to the Request object.
Zend_Controller_Router_Exception |
Implements Zend_Controller_Router_Interface.
setChainNameSeparator | ( | $separator | ) |
Set the separator to use with chain names.
string | $separator | The separator to use |
setGlobalParam | ( | $name, | |
$value | |||
) |
useRequestParametersAsGlobal | ( | $use = null | ) |
Determines/returns whether to use the request parameters as global parameters.
boolean | null | $use | Null/unset when you want to retrieve the current state. True when request parameters should be global, false otherwise |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |