Thinkphp can load the default module. why cannot It load additional modules?

Source: Internet
Author: User
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.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.