Let’s say I have 2 controllers, content and news:
class ContentController extends Zend_Controller_Action { }
and
class NewsController extends ContentController { }
If there are no views found for the news controller, I want Zend to use the scripts path of its parent controller.
How can I achieve this without having to route to its parent controller?
You will have to add the scriptPath manually:
and
This will use the stack functionality of the view script inflector. It will first look in the path last specified, which is APPLICATION_PATH . ‘/views/scripts/news’, if the script isn’t found there, it will look in the second directory on the stack, which is APPLICATION_PATH . ‘/views/scripts/content’.