php kohana框架 view使用
程序员文章站
2024-04-02 20:06:16
...
// 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.
调用https://192.168.0.170/ad/extends/whj
结果:
Otherwise this will show.whjsjq
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.
调用https://192.168.0.170/ad/extends/whj
结果:
Otherwise this will show.whjsjq
以上就介绍了php kohana框架 view使用 ,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。