當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Yaf_Dispatcher::autoRender方法代碼示例

本文整理匯總了PHP中Yaf_Dispatcher::autoRender方法的典型用法代碼示例。如果您正苦於以下問題:PHP Yaf_Dispatcher::autoRender方法的具體用法?PHP Yaf_Dispatcher::autoRender怎麽用?PHP Yaf_Dispatcher::autoRender使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Yaf_Dispatcher的用法示例。


在下文中一共展示了Yaf_Dispatcher::autoRender方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testAutoRender

 public function testAutoRender()
 {
     $this->dispatcher = Yaf_Dispatcher::getInstance();
     $this->assertTrue($this->readAttribute($this->dispatcher, '_auto_render'));
     $this->dispatcher->autoRender(false);
     $this->assertFalse($this->readAttribute($this->dispatcher, '_auto_render'));
     $this->dispatcher->autoRender(true);
     $this->assertTrue($this->readAttribute($this->dispatcher, '_auto_render'));
 }
開發者ID:ligboy,項目名稱:yaf-phpport,代碼行數:9,代碼來源:DispatcherTest.php

示例2: _init

 public function _init(Yaf_Dispatcher $dispatcher)
 {
     // auto start session
     Yaf_Session::getInstance()->start();
     // auto load config data
     $this->config = Yaf_Application::app()->getConfig();
     Yaf_Registry::set('Config', $this->config);
     //auto load redis
     $redis = new Redis();
     $redis->connect($this->config->redis->host, $this->config->redis->port, $this->config->redis->timeout, $this->config->redis->reserved, $this->config->redis->interval);
     Yaf_Registry::set('Redis', $redis);
     //auto load mysql
     Yaf_Registry::set('DbRead', new Db('mysql:host=' . $this->config->mysql->read->host . ';dbname=' . $this->config->mysql->read->dbname . ';charset=' . $this->config->mysql->read->charset . ';port=' . $this->config->mysql->read->port . '', $this->config->mysql->read->username, $this->config->mysql->read->password));
     Yaf_Registry::set('DbWrite', new Db('mysql:host=' . $this->config->mysql->write->host . ';dbname=' . $this->config->mysql->write->dbname . ';charset=' . $this->config->mysql->write->charset . ';port=' . $this->config->mysql->write->port . '', $this->config->mysql->write->username, $this->config->mysql->write->password));
     // auto load model
     Yaf_Registry::set('I18n', new I18nModel($redis, $this->config->application->name, 'cn'));
     Yaf_Registry::set('Cache', new CacheModel($redis, $this->config->application->name));
     // auto load plugin
     $dispatcher->registerPlugin(new GlobalPlugin());
     // auto save request
     $request = $dispatcher->getRequest();
     // auto set ajax is no render
     if ($request->isXmlHttpRequest()) {
         $dispatcher->autoRender(false);
     }
     // auto set http protocol to action except http get protocol
     if (!$request->isGet()) {
         $dispatcher->setDefaultAction($request->getMethod());
     }
 }
開發者ID:a707937337,項目名稱:helloword,代碼行數:30,代碼來源:Bootstrap.php

示例3: _initConfig

 public function _initConfig(Yaf_Dispatcher $dispatcher)
 {
     $config = Yaf_Application::app()->getConfig();
     Yaf_Registry::set("config", $config);
     $sysConfig = (include APP_PATH . "/conf/config.php");
     Yaf_Registry::set("sysConfig", $sysConfig);
     $dispatcher->autoRender(FALSE);
     //全局關閉渲染
 }
開發者ID:sean0402,項目名稱:yarf-framework,代碼行數:9,代碼來源:Bootstrap.php

示例4: _initConfig

 public function _initConfig(Yaf_Dispatcher $dispatcher)
 {
     $dispatcher->autoRender(FALSE);
     Yaf_Registry::set('_config', Yaf_Application::app()->getConfig());
 }
開發者ID:kevin69,項目名稱:Yaf-RESTfull-Test,代碼行數:5,代碼來源:Bootstrap.php

示例5: _initTemplate

 /**
  * @param Yaf_Dispatcher $dispatcher
  */
 public function _initTemplate(Yaf_Dispatcher $dispatcher)
 {
     $dispatcher->autoRender(FALSE);
 }
開發者ID:JianKongBao,項目名稱:AAPF,代碼行數:7,代碼來源:Bootstrap.php

示例6: _initView

 /**
  * 初始化視圖
  * 
  * @param Yaf_Dispatcher $dispatcher
  */
 public function _initView(Yaf_Dispatcher $dispatcher)
 {
     //手動沉浸模板
     $dispatcher->disableView();
     $dispatcher->autoRender(false);
 }
開發者ID:chaoyanjie,項目名稱:HiBlog,代碼行數:11,代碼來源:Bootstrap.php

示例7: _iniYaf

 public function _iniYaf(Yaf_Dispatcher $dispatcher)
 {
     $dispatcher->autoRender(false);
     $dispatcher->disableView();
 }
開發者ID:hzh123,項目名稱:my_yaf,代碼行數:5,代碼來源:Bootstrap.php

示例8: _initView

 public function _initView(Yaf_Dispatcher $dispatcher)
 {
     $dispatcher->autoRender(false);
 }
開發者ID:lanma121,項目名稱:prize,代碼行數:4,代碼來源:Bootstrap.php


注:本文中的Yaf_Dispatcher::autoRender方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。