php - A Generic, catch-all action in Zend Framework... can it be done? -


In this situation, anyone has the desire to make their own "pages" in their web site, creating unrelated actions In. .

Then they say that they have a URL mysite.com/index/books ... they want to be able to create mysite.com/index/booksmore or mysite.com/index/pancakes but not Create any work in the index controller (a non-technical person who can do simple HTML) basically want to create a simple, stable page without using any verb.

As such, there will be some general action in the index controller that handles the request for a non-existent operation. How do you do it or is it possible too?

Edit: A problem in using __call is the lack of a visible file. An action reduction starts but you now have to deal with the missing scene file. The frame will throw an exception if it can not get one (although it may be a method of redirecting the missing visual file __call to 404 on the 404.)

you have to play with a router

I think you can specify a wildcard to capture every action on a specific module ( Decrease the default one url) and an act like this Note that will take care of submitting the URL (or even according to the call process)

New Zend_Controller_Router_Route ('index / *', array ('controller' = & Gt; 'index', 'action' = & gt; 'custom', 'module' => gt; & gt; 'index')

You can only retrieve the parameters in the custom action function And display the block right. I have not tried to do this, so you may have to hack a bit of code


Comments