如何从application.ini引导Zend视图?

时间:2013-06-16 22:31:58

标签: zend-framework zend-view

我正在使用Zend Framework 1.12,我只想在application.ini中引导我的视图。

当前设置:

resources.view[] = ""
resources.view.encoding = "UTF-8"
resources.view.basePath = APPLICATION_PATH "/views/"
resources.view.doctype = "XHTML1_STRICT"
resources.view.contentType = "text/html; charset=UTF-8"
resources.view.helperPath.My_View_Helper = APPLICATION_PATH"/views/helpers"

通过这种设置,我可以使用(例如)内置导航助手。我必须将以下内容附加到Bootstrap:

protected function _initViewHelpers() {

        $this->bootstrap('view');
        $view = $this->getResource('view');

        $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
        $viewRenderer->setView($view);
        $view->env = APPLICATION_ENV;


    }

是否有可能将其移至ini文件?

0 个答案:

没有答案