当前位置: 首页>>代码示例>>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;未经允许,请勿转载。