当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Controller_Action_Helper_ViewRenderer::setViewSuffix方法代码示例

本文整理汇总了PHP中Zend_Controller_Action_Helper_ViewRenderer::setViewSuffix方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Controller_Action_Helper_ViewRenderer::setViewSuffix方法的具体用法?PHP Zend_Controller_Action_Helper_ViewRenderer::setViewSuffix怎么用?PHP Zend_Controller_Action_Helper_ViewRenderer::setViewSuffix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Controller_Action_Helper_ViewRenderer的用法示例。


在下文中一共展示了Zend_Controller_Action_Helper_ViewRenderer::setViewSuffix方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setupView

 /**
  * Configures view class
  *
  */
 protected function setupView()
 {
     if (Zend_Registry::isRegistered('config')) {
         $config = Zend_Registry::get('config');
         $renderClass = $config->output->viewrenderer;
         $viewRenderer = new $renderClass();
         $viewClass = $config->output->view->name;
         $viewRenderer->setView(new $viewClass($config->output->view->options->toArray()));
     } else {
         // Config file not detected, use defaults
         $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
         $viewRenderer->setView(new Zoo_View_Php());
     }
     $viewRenderer->setViewSuffix('phtml');
     //make it search for .phtml files
     Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
     //add it to the action helper broker
     // Set the encoding
     $viewRenderer->view->setEncoding("UTF-8");
     $doctypeHelper = new Zend_View_Helper_Doctype();
     $doctypeHelper->doctype('XHTML1_STRICT');
     // Add core module's view helper path
     $viewRenderer->view->addHelperPath(ZfApplication::$_base_path . "/app/Zoo/views/helpers");
     // Add JQuery support
     $viewRenderer->view->addHelperPath('ZendX/JQuery/View/Helper/', 'ZendX_JQuery_View_Helper');
     $viewRenderer->view->jQuery()->setVersion('1.5')->setUIVersion('1.8')->addStylesheet('http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/smoothness/jquery-ui.css');
 }
开发者ID:BGCX261,项目名称:zoocms-svn-to-git,代码行数:31,代码来源:Http.php

示例2: initView

 /**
  * @return \Application\Smarty\ZendSmarty
  */
 protected function initView()
 {
     $view = $this->getDICContainer()->get('zend_smarty');
     $view->getEngine()->setZendView($view);
     $viewHelper = new \Zend_Controller_Action_Helper_ViewRenderer($view);
     $viewHelper->setViewSuffix('tpl');
     \Zend_Controller_Action_HelperBroker::addHelper($viewHelper);
     $this->getEventDispatcher()->dispatch('bootstrap.init_view', new EventParameters(array('view' => $view)));
     return $view;
 }
开发者ID:Eximagen,项目名称:sochi,代码行数:13,代码来源:Bootstrap.php

示例3: _initNaneau

 public function _initNaneau()
 {
     /** Naneau_View_Smarty */
     require_once 'Naneau/View/Smarty.php';
     $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
     $viewRenderer->setView(new Naneau_View_Smarty(array('compileDir' => APPLICATION_PATH . '/../tmp/templates_c')));
     $viewRenderer->setViewSuffix('tpl');
     //make it search for .tpl files
     Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
     //add it to the action helper broker
 }
开发者ID:vinnivinsachi,项目名称:Vincent-DR,代码行数:11,代码来源:Bootstrap.php

示例4: _initViewHelpers

 public function _initViewHelpers()
 {
     $this->bootstrap('layout');
     $this->bootstrap('view');
     $layout = $this->getResource('layout');
     $layout->setInflectorTarget(':script.:suffix');
     $layout->setViewSuffix('php');
     $view = $this->getResource('view');
     $view->doctype('XHTML1_STRICT');
     $view->headMeta()->appendHttpEquiv('Content-type', 'text/html;charset=utf-8');
     $view->headTitle()->setSeparator(' - ');
     $view->headTitle('eViasWeb Application');
     $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
     $viewRenderer->setView($view);
     $viewRenderer->setViewSuffix('php');
     Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
 }
开发者ID:evias,项目名称:eViasWeb,代码行数:17,代码来源:Bootstrap.php

示例5: testViewSuffixInstanceNotSharedWhenViewHelperIsCloned

 /**
  * @group ZF-11127
  */
 public function testViewSuffixInstanceNotSharedWhenViewHelperIsCloned()
 {
     $a = new Zend_Controller_Action_Helper_ViewRenderer();
     $a->init();
     $a->setViewSuffix('A');
     $this->assertEquals('A', $a->getViewSuffix());
     $b = clone $a;
     $this->assertEquals('A', $b->getViewSuffix());
     $b->setViewSuffix('B');
     $this->assertEquals('B', $b->getViewSuffix());
     $this->assertNotEquals('B', $a->getViewSuffix());
 }
开发者ID:ThorstenSuckow,项目名称:conjoon,代码行数:15,代码来源:ViewRendererTest.php

示例6: _initView

 protected function _initView()
 {
     // Create view
     $view = new Zend_View();
     // Set encoding (@todo maybe use configuration?)
     $view->setEncoding('utf-8');
     $view->addScriptPath(APPLICATION_PATH);
     // Setup and register viewRenderer
     // @todo we may not need to override zend's
     $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer($view);
     $viewRenderer->setViewSuffix('phtml');
     Zend_Controller_Action_HelperBroker::getStack()->offsetSet(-80, $viewRenderer);
     // Add default helper paths
     $view->addHelperPath('Khcn/View/Helper/', 'Khcn_View_Helper_');
     $this->initViewHelperPath();
     // Set doctype
     $doctypeHelper = new Zend_View_Helper_Doctype();
     $doctypeHelper->doctype('XHTML1_STRICT');
     // Add to local container and registry
     Zend_Registry::set('Zend_View', $view);
     return $view;
 }
开发者ID:nhochong,项目名称:qlkh-sgu,代码行数:22,代码来源:Bootstrap.php

示例7: array

/*
 * Register the logging and sanity checking plugins with the front controller
 */
$front->registerPlugin(new QFrame_Controller_Plugin_Log());
/*
 * Register the EzcExecution plugin with the front controller
 */
$front->registerPlugin(new QFrame_Controller_Plugin_EzcExecution());
/*
 * Set up a QFrame_View object, add the path to the helper directory, and set it up
 * as the default view object
 */
$view = new QFrame_View();
$view->addHelperPath(implode(DIRECTORY_SEPARATOR, array(APPLICATION_PATH, 'views', 'helpers')));
$view->addHelperPath(implode(DIRECTORY_SEPARATOR, array(LIBRARY_PATH, 'Zend', 'View', 'Helper')), 'Zend_View_Helper');
$viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer($view);
$viewRenderer->setViewSuffix('haml')->setViewScriptPathSpec('scripts/:controller/:action.:suffix');
Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
/*
 * Finally, we are going to actually add some routes...
 */
$router = $front->getRouter();
$router->addRoute('default', new Zend_Controller_Router_Route(':controller/:action/:id', array('controller' => 'index', 'action' => 'index', 'id' => 0)));
/*
 * Set up the base url before dispatching
 */
$front->setBaseUrl(QFrame_Config::instance()->base_url);
/*
 * And last of all dispatch the front controller
 */
$front->dispatch();
开发者ID:humansky,项目名称:qframe,代码行数:31,代码来源:boot.php

示例8: _viewRendererSuffix

 /**
  * Set VR view suffix
  *
  * @param Zend_Controller_Action_Helper_ViewRenderer $viewRenderer
  * @param Zend_Config $config
  */
 protected function _viewRendererSuffix(Zend_Controller_Action_Helper_ViewRenderer $viewRenderer, Zend_Config $config)
 {
     if ($config->get('suffix') !== null) {
         $viewRenderer->setViewSuffix($config->get('suffix'));
     }
 }
开发者ID:BGCX262,项目名称:zym-svn-to-git,代码行数:12,代码来源:View.php

示例9: iniViewSmarty

 /**
  * Initialization Smarty templating
  *
  * @param string $module
  */
 private function iniViewSmarty($module)
 {
     // Установим шаблоны для модуля
     $vr = new Zend_Controller_Action_Helper_ViewRenderer();
     $vr->setView(new Default_Plugin_ViewSmarty($module));
     $vr->setViewSuffix('tpl');
     Zend_Controller_Action_HelperBroker::addHelper($vr);
 }
开发者ID:bsa-git,项目名称:zf-myblog,代码行数:13,代码来源:AclManager.php

示例10: _initView

 protected function _initView()
 {
     // Create view
     $view = new Zend_View();
     // Set encoding (@todo maybe use configuration?)
     $view->setEncoding('utf-8');
     $view->addScriptPath(APPLICATION_PATH);
     // Setup and register viewRenderer
     // @todo we may not need to override zend's
     $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer($view);
     //$viewRenderer = new Engine_Controller_Action_Helper_ViewRenderer($view);
     $viewRenderer->setViewSuffix('tpl');
     Zend_Controller_Action_HelperBroker::getStack()->offsetSet(-80, $viewRenderer);
     // Initialize contextSwitch helper
     Zend_Controller_Action_HelperBroker::addHelper(new Core_Controller_Action_Helper_ContextSwitch());
     // Add default helper paths
     $view->addHelperPath('Engine/View/Helper/', 'Engine_View_Helper_');
     $this->initViewHelperPath();
     // Set doctype
     Engine_Loader::loadClass('Zend_View_Helper_Doctype');
     $doctypeHelper = new Zend_View_Helper_Doctype();
     $doctypeHelper->doctype(Engine_Api::_()->getApi('settings', 'core')->getSetting('core.doctype', 'HTML4_LOOSE'));
     // Add to local container and registry
     Zend_Registry::set('Zend_View', $view);
     return $view;
 }
开发者ID:hoalangoc,项目名称:ftf,代码行数:26,代码来源:Bootstrap.php

示例11: array

Zend_Loader::registerAutoload();
require_once '../include/Templater.php';
require_once '../include/CustomControllerAction.php';
//
//    // load the application configuration
$config = new Zend_Config_Ini('../settings.ini', 'development');
Zend_Registry::set('config', $config);
//
//
// create the application logger
$logger = new Zend_Log(new Zend_Log_Writer_Stream($config->logging->file));
Zend_Registry::set('logger', $logger);
//
//
//    // connect to the database
$params = array('host' => $config->database->hostname, 'username' => $config->database->username, 'password' => $config->database->password, 'dbname' => $config->database->database);
$db = Zend_Db::factory($config->database->type, $params);
Zend_Registry::set('db', $db);
//
//
//    // handle the user request
$controller = Zend_Controller_Front::getInstance();
$controller->setControllerDirectory($config->paths->base . '/include/Controllers');
//
//    // setup the view renderer
$vr = new Zend_Controller_Action_Helper_ViewRenderer();
$vr->setView(new Templater());
$vr->setViewSuffix('tpl');
Zend_Controller_Action_HelperBroker::addHelper($vr);
//
$controller->dispatch();
开发者ID:renatosoares,项目名称:blog-zend1,代码行数:31,代码来源:index.php


注:本文中的Zend_Controller_Action_Helper_ViewRenderer::setViewSuffix方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。