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