1. Loading template times wrong: Class ' Model ' not found file:e:\wamp\www\thinkphp\application\home\model\formmodel.class.php line:7
Solution: Namespace Home\model; Use Think\model; Add a namespace. and must be placed in the first line of the code, or it will be an error and does not work.
Error in New Model () method: $Model = new Model () Hint: Class ' home\controller\model ' not found
Error location: file:e:\wamp\www\kschao\wwwroot\application\home\controller\indexcontroller.class.php line:21
Getlastsql () Error: Hint: Call to a member function Getlastsql () on a non-object
The code is as follows: $student = new Model (' student '); $result = $student->select (); Echo $result->getlastsql ();
Change to $student = new Model (' student '); $result = $student->select (); Echo $student->getlastsql (); OK. The reason is that only the Getlastsql () method can be used on the model
2. Routing
Step1: Open route in project configuration instead of in system configuration
Step2: Set routing Rules routing rules into regular routes and regular routes.
3.php cache?????
3. Empty templates and empty operations
4. Front-and rear-mounted operations
function _before_index ()
function _after_index ()
4. Page jumps and page redirection
Built-in two jump method error and success, respectively for error jump and successful jump. Automatically jumps to the specified address, but the URL address does not change
The built-in Redirect method implements page redirection, which changes the current URL address after redirection.
5. Automatic verification and auto-completion
Auto-Verify: Protected $_validate () =array () Auto-complete: protected $_auto=array ()
Thinkphp learn a little mind