嗨我需要一个zend布局加载器的帮助以下是我的代码不能正常工作!!
public function preDispatch(){
$bootstrap = $this->getActionController()->getInvokeArg('bootstrap');
$config = $bootstrap->getOptions();
Zend_Registry::set('config', $config);
$module = $this->getRequest()->getModuleName();
$controller = $this->getRequest()->getControllerName();
$action = $this->getRequest()->getActionName();
}
感谢
答案 0 :(得分:0)
public function preDispatch(){
$bootstrap = $this->getActionController()->getInvokeArg('bootstrap');
$config = $bootstrap->getOptions();
Zend_Registry::set('config', $config);
$module = $this->getRequest()->getModuleName();
$controller = $this->getRequest()->getControllerName();
$action = $this->getRequest()->getActionName();
$layoutScript = "layout";
if (isset($config[$module]['resources']['layout']['layout'])) {
$layoutScript = $config[$module]['resources']['layout']['layout'];
}
$this->getActionController()->getHelper('layout')->setLayout($layoutScript);
}
感谢