As above, the 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 classes: UserModel.class.php
namespace Home\model;
Use Think\model;
Class Usermodel extends Model {
Public Function login () {
echo "1234";
}
}
Just said wrong is the hint: Err:think\model:login method does not exist! Why didn't he call the custom model class?
Reply to discussion (solution)
Problem solving with large D ("user"); The error table does not exist, open config to comment out the table prefix directly reported UserModel.class.php inside error, after processing the table prefix open run OK the details inside let me still very faint I hope that the great God help me solve why not directly error?