Home > Article > Backend Development > php kohana framework view usage
// 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.