Please help! I am a newbie to Zend and want to modifiy the default routing for a cms project I am working on.
How do I create a "catch all" route in zend should a controller not exist?
I am trying to create links like:
mydomain.com/slug
mydomain.com/slug1
Where slug and slug1 can be passed as params to a specified default controller (pagesController) so I can fetch the appropriate content from the DB.
I apprecaite any help!! :)
One way to do it is to write a simple Controller Plugin that tests whether a request is otherwise dispatchable, and if not, send it to your page controller/action:
And make sure you register it with your frontcontroller:
Bootstrap.php:
Instead of overriding the preDispatch, you could also do this in the routeShutdown. This was the only way to getting this up for me.