Yaf_Dispatcher
PHP Manual

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

警告

この関数は、 現在のところ詳細な情報はありません。引数のリストのみが 記述されています。

パラメータ

flag

bool

返り値

例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 Manual