ZF-12427: Documentation needed for adding parameter requirements via Zend_Application_Resource_Router

Issue Type: Docs: Problem Created: 2012-09-27T13:26:55.000+0000 Last Updated: 2012-11-06T21:25:26.000+0000 Status: Resolved Fix version(s): - 1.12.1 (18/Dec/12)

Reporter: Andrew Ballard (aballard) Assignee: Frank Brückner (frosch) Tags: - Zend_Application_Resource

  • FixForZF1.12.1

Related issues: Attachments: - de.Zend_Application-AvailableResources-Router.xml.patch


The manual section for Zend_Application_Resource_Router shows an example of how to create a route with parameter defaults, but it does not show how to add parameter requirements. This is important because while the key "defaults" is spelled out, for some reason the key "requirements" has been abbreviated in the code as "reqs". As a result, the correct syntax should be:

<pre class="highlight">
resources.router.routes.route_id.route = "/product/:product_id"
resources.router.routes.route_id.defaults.module = "default"
resources.router.routes.route_id.defaults.controller = "product"
resources.router.routes.route_id.defaults.action = "info"
resources.router.routes.route_id.reqs.product_id = "^\d+$"


Posted by Frank Brückner (frosch) on 2012-09-27T14:52:12.000+0000

Patches added. (English and German)

Posted by Frank Brückner (frosch) on 2012-09-27T14:53:29.000+0000

@[~aballard] Thanks for reporting!

Posted by Rob Allen (rob) on 2012-11-06T21:25:26.000+0000

Patch applied on trunk (25088) and release-1.12 (25089)

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.