Add a optional parameter in default Zend route?

You can extend Zend_Controller_Router_Rewrite and change the default router settings and URL assembling, and then use setRouter() on your Zend_Controller_Front to use your new router instance instead of the default. Search for class Zend_Controller_Router_Rewrite and learn it before doing so.

You can extend Zend_Controller_Router_Rewrite and change the default router settings and URL assembling, and then use ->setRouter() on your Zend_Controller_Front to use your new router instance instead of the default. Search for class Zend_Controller_Router_Rewrite and learn it before doing so.

Yeap, this is what I am trying to avoid. I though there was a way to make this work simply adding routes :( – Fernando Barrocal Oct 7 at 19:27 Adding a route might help to access the right controller/actions, but you still need to make changes to the router to allow generating URLs in a different setting. You could always use setGlobalParam to avoid changes to the router, but then links won't always look like the one you suggested.

– Dvir Azulay Oct 7 at 19:33 I opted to use a modified version of Zend_Controller_Router_Route_Module Instead of the Rewrite one! Then I use it on Bootstrap! I let you know the result, working on it now!

– Fernando Barrocal Oct 7 at 19:45.

The solution was indeed to extend Zend_Controller_Router_Route_Abstract and create a new Route handler to go through the url, verify the existence of modules, areas, controllers and actions to build a full functional url or dispatch to the error controller. The heavy work is done between the match() and assemble() methods and I used as reference the Zend class Zend_Controller_Router_Route_Module tht do similar task for the module, but instead of verifying if module exists with the dispatcher I created a whitelist of allowed areas, if it fails to match, it considers that that path part is the controller, the next the action and further parts are parameters. It worked like magic!

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions