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


PHP Yaf_Dispatcher::setView方法代码示例

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


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

示例1: _initView

 protected function _initView(Yaf_Dispatcher $dispatcher)
 {
     $view = new YafView(APPLICATION_VIEW_SCRIPTS_PATH);
     $view->enableLayout('layout/normal.phtml');
     $dispatcher->setView($view);
     //        $dispatcher->setView(new YafView(APPLICATION_VIEW_SCRIPTS_PATH));
 }
开发者ID:YexuanGuo,项目名称:php-cms,代码行数:7,代码来源:Bootstrap.php

示例2: initYafBySooh

 /**
  * 
  * @param \Yaf_Dispatcher $dispatcher
  * @param  string $jqueryVer 使用的jquery文件,默认值:jquery-1.11.2.min.js
  * @return view
  */
 public static function initYafBySooh($dispatcher, $jqueryVer = 'jquery-1.11.2.min.js')
 {
     $router = $dispatcher->getRouter();
     $router->addRoute("byVar", new \Yaf_Route_Supervar(SOOH_ROUTE_VAR));
     \Yaf_Loader::getInstance()->registerLocalNameSpace($GLOBALS['CONF']['localLibs']);
     $req = $dispatcher->getRequest();
     $tmp = $req->get('__ONLY__');
     if ($tmp == 'body') {
         \SoohYaf\Viewext::$bodyonly = true;
     }
     $tmp = trim($req->get('__VIEW__'));
     //html(default),wap,  json
     define('VIW_INC_PATH', APP_PATH . '/application/views/_inc/');
     \SoohYaf\Viewext::$jqueryVer = $jqueryVer;
     if (!empty($tmp)) {
         $tmp = strtolower($tmp);
         \Sooh\Base\Ini::getInstance()->viewRenderType($tmp);
         if ($tmp == 'jsonp') {
             \Sooh\Base\Ini::getInstance()->initGobal(array('nameJsonP' => $req->get('jsonp', 'jsonp')));
         }
     }
     //		$tmp = $dispatcher->getRequest()->get('__GZIP__');
     //		if(!empty($tmp)){
     //			$tmp = strtolower ($tmp);
     //			if($tmp=='gzip')define("ZIP_OUTPUT",$tmp);
     //		}
     $view = new \SoohYaf\Viewext(null);
     $dispatcher->setView($view);
     $dispatcher->registerPlugin(new SoohPlugin());
     return $view;
 }
开发者ID:hillstill,项目名称:soohyaf,代码行数:37,代码来源:SoohPlugin.php

示例3: _initSmarty

 public function _initSmarty(Yaf_Dispatcher $dispatcher)
 {
     /* init smarty view engine */
     Yaf_Loader::import("Smarty/Adapter.php");
     $smarty = new Smarty_Adapter(null, Yaf_Application::app()->getConfig()->smarty);
     $dispatcher->setView($smarty);
 }
开发者ID:gangjun911,项目名称:yaf-examples,代码行数:7,代码来源:Bootstrap.php

示例4: _initView

 public function _initView(Yaf_Dispatcher $dispatcher)
 {
     //在这里注册自己的view控制器,例如smarty,firekylin
     $smarty = new Smarty_Adapter(null, Yaf_Registry::get("config")->get("smarty"));
     Yaf_Registry::set("smarty", $smarty);
     $dispatcher->setView($smarty);
     //Yaf_Dispatcher::getInstance()->disableView();
     //var_dump('sssss');
 }
开发者ID:hexing-w,项目名称:flower-yaf,代码行数:9,代码来源:Bootstrap.php

示例5: _initLayout

 public function _initLayout(Yaf_Dispatcher $dispatcher)
 {
     // Enable template layout only on admin
     // TODO: make this more accurate
     if (strpos($dispatcher->getRequest()->getRequestUri(), "admin") !== FALSE && strpos($dispatcher->getRequest()->getRequestUri(), "edit") === FALSE && strpos($dispatcher->getRequest()->getRequestUri(), "confirm") === FALSE && strpos($dispatcher->getRequest()->getRequestUri(), "logDetails") === FALSE) {
         $path = Billrun_Factory::config()->getConfigValue('application.directory');
         $view = new Yaf_View_Simple($path . '/views/layout');
         $dispatcher->setView($view);
     }
 }
开发者ID:kalburgimanjunath,项目名称:system,代码行数:10,代码来源:Bootstrap.php

示例6: _initView

 public function _initView(Yaf_Dispatcher $dispatcher)
 {
     $uri = $dispatcher->getRequest()->getRequestUri();
     if ($uri) {
         $uriArray = explode('/', $dispatcher->getRequest()->getRequestUri());
         switch ($uriArray[1]) {
             case 'admin':
                 $viewPath = APPLICATION_PATH . '/modules/Admin/views';
                 break;
             default:
                 $viewPath = APPLICATION_PATH . '/views';
         }
         $view = new TwigAdapter($viewPath, Yaf_Registry::get('config')->get('twig')->toArray());
         $dispatcher->setView($view);
     }
 }
开发者ID:yinliguo,项目名称:phpBase,代码行数:16,代码来源:Bootstrap.php

示例7: _initView

 public function _initView(Yaf_Dispatcher $dispatcher)
 {
     $myView = new View(NULL);
     $dispatcher->setView($myView);
 }
开发者ID:kevin69,项目名称:Yaf-RESTfull-Test,代码行数:5,代码来源:Bootstrap.php

示例8: _initView

 public function _initView(Yaf_Dispatcher $dispatcher)
 {
     //命令行下基本不需要使用smarty
     if (REQUEST_METHOD != 'CLI') {
         $smarty = new Smarty_Adapter(null, $this->config->smarty);
         $smarty->registerFunction('function', 'truncate', array('Tools', 'truncate'));
         $dispatcher->setView($smarty);
     }
 }
开发者ID:liu33851861,项目名称:CZD_Yaf_Extension,代码行数:9,代码来源:Bootstrap.php

示例9: _initLayout

 public function _initLayout(Yaf_Dispatcher $dispatcher)
 {
     $layout = new View_Layout($this->config->application->layout->directory);
     $dispatcher->setView($layout);
 }
开发者ID:kaka987,项目名称:YoungYaf,代码行数:5,代码来源:Bootstrap.php

示例10: _initView

 /**
  * [默认视图类(报错已用)]
  * @param  Yaf_Dispatcher $dispatcher [description]
  * @return [type]                     [description]
  */
 public function _initView(Yaf_Dispatcher $dispatcher)
 {
     $dispatcher->setView(new View(null));
 }
开发者ID:zhangxinvip,项目名称:YafUse,代码行数:9,代码来源:Bootstrap.php

示例11: _initView

 public function _initView(Yaf_Dispatcher $dispatcher)
 {
     //在这里注册自己的view控制器,例如smarty,firekylin
     $view = new View_Twig(APPLICATION_PATH . "/application/views/", Yaf_Registry::get("config")->get("twig")->toArray());
     $dispatcher->setView($view);
 }
开发者ID:cooltime,项目名称:material,代码行数:6,代码来源:Bootstrap.php


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