I got this working now. The reason my routes were not matching the way I
thought they should is because during the dispatch process, inside the
Zend_Controller_Router_Rewrite->route() method the array of routes is
reversed.
So all I had to do was re-shuffle the order of my routes the other way
round and now the router finds them correctly.
Cheers,
Chris
Chris MacPherson wrote:
I am using some custom routes for my site and a couple are
conflicting. Is there a way to set them up so both the following
routes point to their respective actions.
At the moment these both point point to the 'item-view' action, I was
hoping the first one would match
http://www.a.com/default/foo/bar/create but instead it is being caught
in the second route.
new Zend_Controller_Router_Route('default/foo/bar/create',
array('module' => 'default', 'controller' => 'foo', 'action' =>
'foo-bar-create'));
new Zend_Controller_Router_Route('default/foo/bar/:itemId',
array('module' => 'default', 'controller' => 'foo', 'action' =>
'foo-bar-view'));
Is there any way to give the first route above a higher prioirty than
the second route to solve the problem?
Cheers,
Chris