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

php kohana framework view usage

巴扎黑
巴扎黑Original
2016-11-11 09:31:421533browse

// Exends.php in the controller directory
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.

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