Maison > Article > développement back-end > php kohana框架 view使用
// controller 目录下 exends.php
class Controller_Extends extends Controller{
public function action_whj(){
$state = "whjsjq";
$expression = false;
$view = View::factory('application/whj');//调用视图模版文件
$view->state = $state;//赋值视图变量
$view->expression = $expression;//赋值视图变量
$this->response->body($view);
}
}
?>
//view/application目录下 whj.php
This will show if the expression is true.
Otherwise this will show.