zend预分配布局加载器



hi我需要关于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();
}

感谢

    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);
}

感谢

最新更新