Thinkphp3.2.0 version D method call custom model class display cannot find this class, ClassHomeModelUserModelnotfound as above, controller UserController. class. php
Namespace Home \ Controller;
Use Think \ Controller;
Use Home \ Model \ UserModel;
Class UserController extends Controller {
Public function index (){
$ User = D ('user')-> login ();
Print_r ($ user );
}
}
Custom model class: UserModel. class. php
Namespace Home \ Model;
Use Think \ Model;
Class UserModel extends Model {
Public function login (){
Echo & quot; 1234 & quot ";
}
}
The error message "ERR: Think \ Model: login" does not exist! Why didn't he call the custom model class?
Reply to discussion (solution)
To solve the problem, use big D ('user'). If the error table does not exist, open config and comment out the table prefix and report UserModel directly. class. an error occurs in php. after processing the table prefix, it is okay to run the table prefix. I am still dizzy. hope you guys can help me solve the problem. why don't I directly report an error?