Yaf_Dispatcher
在线手册:中文 英文
PHP手册

Yaf_Dispatcher::autoRender

(PECL yaf >=1.0.0)

Yaf_Dispatcher::autoRenderSwitch on/off autorendering

说明

public Yaf_Dispatcher Yaf_Dispatcher::autoRender ( bool $flag )

Yaf_Dispatcher will render automatically after dispatches a incoming request, you can prevent the rendering by calling this method with flag TRUE

Warning

本函数还未编写文档,仅有参数列表。

参数

flag

bool

返回值

范例

Example #1 Yaf_Dispatcher::autoRender()example

<?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);
         }
     } 
}
?>

以上例程的输出类似于:


Yaf_Dispatcher
在线手册:中文 英文
PHP手册