Yaf_Controller_Abstract::render
(Since Yaf 1.0.0.5)
public Yaf_Response_Abstract Yaf_Controller_Abstract::render( string $action ,
array $tpl_vars
= NULL );
渲染视图模板, 得到渲染结果
![]() |
注意 |
|---|---|
| 此方法是对Yaf_View_Interface::render的包装 |
例 11.53. Yaf_Controller_Abstract::render 的例子
<?php
class IndexController extends Yaf_Controller_Abstract {
public funciton init() {
/* 首先关闭自动渲染 */
Yaf_Dispatcher::getInstance()->disableView();
}
public function indexAction() {
$this->initView();
/* 自己输出响应 */
echo $this->render("test.phtml");
}
}
?>