Thinkphp can load the default module. what is the cause of the failure to load the additional Module? thinkphp is based on the video example. if the following & nbsp; url is acceptable, IndexAction. class. php & nbsp; can run localhostthinkpAdmin. php but enter & nbsp; localhostthinkpAdmin. ph thinkphp can load default modules. why cannot I load additional modules?
Based on the thinkphp video example,
If you use the following url, IndexAction. class. php can run
Http: // localhost/thinkp/Admin. php/
However, enter http: // localhost/thinkp/Admin. php/User/index/
Or
Http: // localhost/thinkp/Admin. php/User/index/
All of the following problems
Error location: FILE: E: \ wamp \ www \ thinkp \ ThinkPHP \ Lib \ Think \ Core \ App. class. php LINE: 297
[Error message]
Unable to load module User
[TRACE]
[15-07-19 01:18:07] E: \ wamp \ www \ thinkp \ ThinkPHP \ Lib \ Think \ Core \ App. class. php (297) App: exec ()
[15-07-19 01:18:07] E: \ wamp \ www \ thinkp \ admin. php (12) App: run ()
The admin. php file is in the root directory.
Define ('app _ name', 'admin ');
Define ('app _ path', 'admin ');
Define ('think _ path', './thinkphp ');
Require THINK_PATH. '/ThinkPHP. php ';
App: run ();
?>
Put the UserAction file and IndexAction. class. php in the Action directory.
E: \ wamp \ www \ thinkp \ Admin \ Lib \ Action \ UserAction. class. php
Class UserAction extends Action {
Function index (){
Echo 'User list ';
}
Function add (){
Echo 'user/add ';
}
}
?>
------ Solution ----------------------
I suggest you carefully read the development manual http://document.thinkphp1.cn/manual_3_2.html
------ Solution ----------------------
The APP_PATH definition is incorrect. check the manual. It is better to learn from videos and manuals. many videos cannot be mentioned.
------ Solution ----------------------
However, enter http: // localhost/thinkp/Admin. php/User/index/
Or
Http: // localhost/thinkp/Admin. php/User/index/
All of the following problems
Are these two different?
Define ('app _ name', 'admin'); Admin should be folder.
Http: // localhost/thinkp/Admin/User/index.