コード例 #1
0
ファイル: Bootstrap.php プロジェクト: laiello/digitalus-cms
 /**
  * Initialize the view
  *
  * @return Zend_View
  */
 protected function _initView()
 {
     // Initialize view
     $view = new Zend_View();
     $this->bootstrap('siteSettings');
     // Get settings resource
     $settings = $this->getResource('siteSettings');
     // Set doctype and charset
     $view->doctype($settings->get('doc_type'));
     $view->placeholder('charset')->set($settings->get('default_charset'));
     $view->addFilterPath('Digitalus/View/Filter', 'Digitalus_View_Filter');
     $view->setFilter('Translate');
     // Add the view to the ViewRenderer
     $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
     $viewRenderer->setView($view);
     // base helpers
     $view->addHelperPath('Digitalus/View/Helper', 'Digitalus_View_Helper');
     $view->addHelperPath('Digitalus/Content/Control', 'Digitalus_Content_Control');
     // Load digitalus helpers
     $helperDirs = Digitalus_Filesystem_Dir::getDirectories(BASE_PATH . '/library/Digitalus/View/Helper');
     if (is_array($helperDirs)) {
         foreach ($helperDirs as $dir) {
             $view->addHelperPath(BASE_PATH . '/library/Digitalus/View/Helper/' . $dir, 'Digitalus_View_Helper_' . ucfirst($dir));
         }
     }
     $view->baseUrl = $this->_front->getBaseUrl();
     // Return it, so that it can be stored by the bootstrap
     return $view;
 }