Is anyone using Zend Navigation in conjunction with URLs that require dynamic parameters?
Zend_Navigation seems really easy when dealing with static routes, but I can't figure out any way to make it play nice with dynamic URL parameters.
A route like:
routes.editUser.route = '/users/:id/edit'
routes.editUser.defaults.controller = 'user'
routes.edutUser.defaults.action = 'edit'
In this navigation:
<pages>
<editUser>
<controller>users</controller>
<action>edit</action>
<route>editUser</route>
</editUser>
</pages>
Just throws an error in Zend_Navigation unless I specify a default value for :id
. However, it is no use to me if I can't inject the actual user id when the menu is constructed.
Is there a straightforward way to do this? Thanks.