Home  >  Article  >  Backend Development  >  php kohana framework view usage

php kohana framework view usage

WBOY
WBOYOriginal
2016-08-08 09:23:18986browse

// controller directory extends.php
class Controller_Extends extends Controller{
Public function action_whj(){
$state = "whjsjq";
$expression = false;
$view = View::factory(' application/whj');//Calling the view template file
$view->state = $state;//Assigning the view variable
$view->expression = $expression;//Assigning the view variable
$this-> response->body($view);
}
}
?>
//whj.php in the view/application directory

This will show if the expression is true.

Otherwise this will show.

Call https://192.168 .0.170/ad/extends/whj
Result:
Otherwise this will show.whjsjq

The above introduces the use of PHP Kohana framework view, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn