In Zend MVC, how do you add a view for a page in a subpath?
/controller/action
but what if we have
/controller/action/subaction
How do you add this "subaction" to c开发者_如何学Controller?
There are no sub-actions in an MVC design.
What you can do is set "subaction" as a parameter or argument to the action. If you don't want to use the default param/value
pairing, you would need to set up a custom route to recognise a single value.
To choose a different view, you use the ViewRenderer
action helper. See ZEND, rendering different view with data
you can create Facades somewhere else, then write mod_rewrite to redirect all ^/controller/.* URLs to /controller/ and redirect all requests in init() method to correspondent method in Facade
you can also try to create something like YourController that extends Zend_Controller_Action, and modify all controllers to extend that controller
精彩评论