This is the way that I have module specific layouts in one my projects, it might be of some use to you:
(application.ini)
Code:# Layout initialisation resource resources.Zend_Application_Resource_Layout.options.layoutPath = APPLICATION_PATH "/views/layouts" resources.Zend_Application_Resource_Layout.options.pluginClass = "Project_Module_Layout_Plugin"
So for any requested module its going to look for the layout within /modules/[moduleName]/views/layouts/layout.phtml by default.Code:class Project_Module_Layout_Plugin extends Zend_Layout_Controller_Plugin_Layout { public function preDispatch(Zend_Controller_Request_Abstract $request) { $moduleLayoutPath = APPLICATION_PATH . '/modules/' . $request->getModuleName() . '/views/layouts/'; $layout = $this->getLayout(); if(file_exists($moduleLayoutPath . $layout->getLayout() . '.' . $layout->getViewSuffix())) { $layout->setLayoutPath($moduleLayoutPath); } } }
As to your second question, within any action you can call:
which will use /views/layouts/otherlayout.phtmlCode:$this->_helper->layout->setLayout('otherlayout');


LinkBack URL
About LinkBacks
roduction]



Reply With Quote