PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Zend_Application_Resource_Router

Zend_Application_Resource_Router can be used to configure the router as it is registered with the Front Controller. Configuration options are per the Zend_Controller_Router_Route options.

Example 49. Sample Router Resource configuration

Below is a sample INI snippet showing how to configure the router resource.

resources.router.routes.route_id.route               = "/login"
resources.router.routes.route_id.defaults.module     = "admin"
resources.router.routes.route_id.defaults.controller = "user"
resources.router.routes.route_id.defaults.action     = "login"

; Optionally you can also set a Chain Name Separator:
resources.router.chainNameSeparator = "_"

; Example with parameter
resources.router.routes.route_id.route               = "/user/:user_id"
resources.router.routes.route_id.defaults.module     = "admin"
resources.router.routes.route_id.defaults.controller = "user"
resources.router.routes.route_id.defaults.action     = "edit"
resources.router.routes.route_id.reqs.user_id        = "^\d+$"

For more information on the Chain Name Separator, please see its section.


Zend Framework