Yaf_Dispatcher::autoRender

(Yaf >=1.0.0)

Yaf_Dispatcher::autoRender锟斤拷锟斤拷/锟截憋拷锟皆讹拷锟斤拷染锟斤拷锟斤拷

说锟斤拷

public Yaf_Dispatcher::autoRender ( bool $flag ) : Yaf_Dispatcher

锟节匡拷锟斤拷锟斤拷锟斤拷锟斤拷锟�(Yaf默锟较匡拷锟斤拷)锟斤拷action执锟斤拷锟斤拷锟斤拷院锟�Yaf_Dispatcher 锟斤拷锟皆讹拷锟斤拷锟斤拷view锟斤拷锟斤拷去锟斤拷染锟斤拷action锟斤拷应锟斤拷锟斤拷图模锟藉。 锟斤拷也锟斤拷锟斤拷通锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟� flag 锟斤拷锟斤拷锟斤拷值锟斤拷为TRUE锟斤拷锟剿癸拷锟斤拷预锟斤拷锟斤拷

Note:

锟斤拷锟斤拷锟斤拷锟揭伙拷锟絘ction锟叫斤拷锟斤拷锟斤拷锟斤拷FALSE锟斤拷锟斤拷止锟斤拷前action锟斤拷应锟斤拷图锟斤拷锟皆讹拷锟斤拷染

锟斤拷锟斤拷

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

}
?>

锟斤拷锟斤拷锟斤拷锟教碉拷锟斤拷锟斤拷锟斤拷锟斤拷冢锟�