1. Simple view call
<?php namespace Home\Controller; use Think\Controller; class UserController extends Controller { public function login(){ $this->display();//Display the view (the name is the same as the current operation method) //$this->display('register');//You can access other names HTML //$this->display('Goods/detail');//Access specific template files under other controllers }
public function register(){ $this->display(); }
First create the login method $this->display( ) in the User controller ;
Create a User folder in the view file ( the domain controller name is the same ) Create login.html in User
Methods in the same controller inherit from the same file
Parameters can be passed in display(),
//$this->display('register');//You can access other names HTML
//$this->display('Goods/detail');//Access specific template files under other controllers
访问:http://localhost/php004/Home/User/login