`

yii $this->widget

    博客分类:
  • YII
 
阅读更多

 

public function widget($className,$properties=array(),$captureOutput=false)
{
    if($captureOutput)
    {
        ob_start();
        ob_implicit_flush(false);
        $widget=$this->createWidget($className,$properties);
        $widget->run();
        return ob_get_clean();
    }
    else
    {
        $widget=$this->createWidget($className,$properties);
        $widget->run();
        return $widget;
    }
} 

 

如果想捕获输出的内容,可通过:

 

 

ob_start();
ob_implicit_flush(false);
.....
.....
return ob_get_clean();
分享到:
评论
Global site tag (gtag.js) - Google Analytics