當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。