Hi, i'm developing a simple cms using the zend framework, it's going well. I have allowed users to be able to store url's in the db that they would like to add content to. Now i am looking at adding custom actions, and after that, custom controllers.

At the moment the new action (and it's corresponding controller) is stored in a db, and a controller helper looks in the db on each request (predispatch) to see if the url is one that has dynamic content. If so, it injects this content into the view.

I am now at the stage where the user would like to add custom actions (ie mydomain.com/existing-page/new-sub-page) and custom controllers (ie mydomain.com/new-page/new-sub-page).

So i am looking for help with ways that i can hook onto the controller, that if the url describes the current controller but has an action that is not contained in the class (but has been created by the user in the db, to store dynamic content in), to then redirect any "missing" actions to some sort of default action -but only if the url is verified in the db. I don't want all calls redirected to a single action, as there are also standard / hard-coded views and actions that need to work too. I imagine like when a class is called with an invalid method name, it resolves to __call. Something like that, i suppose, but preferably in postDispatch.

Alternatively, what about doing the complete opposite - let the application manually open and write to the actual files (ie create a controller file, write a skeleton zend_controller_action class to it, write a view script in the correct location etc)?