Yaf_Dispatcher::autoRender
(Yaf >=1.0.0)
Yaf_Dispatcher::autoRender — 开启/关闭自动渲染
参数
flag
-
bool
注意:
自 2.2.0 起。如果没有指定此参数,则会返回当前状态
返回值
示例
示例 #1 Yaf_Dispatcher::autoRender() 示例
<?php
class IndexController extends Yaf_Controller_Abstract {
/* init method will be called as soon as a controller is initialized */
public function init() {
if ($this->getRequest()->isXmlHttpRequest()) {
//do not call render for ajax request
//we will outpu a json string
Yaf_Dispatcher::getInstance()->autoRender(FALSE);
}
}
}
?>
以上示例的输出类似于:
+添加备注
用户贡献的备注
此页面尚无用户贡献的备注。
备份地址:http://www.lvesu.com/blog/php/yaf-dispatcher.autorender.php