An thinkphp entry-level issue

Source: Internet
Author: User
I novice, today in the test study thinkphp encountered a confusion, ask the big God pointing:
The code is simple, there is only one indexaction (auto-generated), there is an index method and test method, I use the URL pattern is the rewrite mode (' Url_model ' + 2), rewrite rules have been written, However, when accessing the test method is always unsuccessful, according to the manual, it should be http://www.admin.me/Index/test, but I test always error: Unable to load the module: test, (regardless of the Index at the beginning of the case is the same), and the HTTP ://www.admin.me/index/index/test when the normal access, I want to ask is the most front of the index is what ah? Not that the first parameter is the module name, the second parameter is the action name? Why is there a two index? My project folder is the app, file structure for the Great God guidance!!


Reply to discussion (solution)

The first one is the total import file, the second index is your controller is the file that inherits the action, the third test is your method, that is, the code block function of processing, do not know that you know it??? Hope to help you

The first one is the total import file, the second index is your controller is the file that inherits the action, the third test is your method, that is, the code block function of processing, do not know that you know it??? I hope to help you thank you for your reply, but my file structure does not have index this file name ah?

Looks like you didn't follow the rules, you have to conform to the TP rules,

It seems you did not follow the rules, ah, you have to comply with the rules of TP, hehe! I didn't do anything, just add a test function to the indexaction. Even the indexaction are thinkphp automatically generated, and then modified the URL pattern to 2, add a. htaccess file (this file is copied from the manual, rewrite rules can not be wrong) ... That's all. The rest is the URL access problem, there is no way to violate the rules, right?

Then in the same directory with the think file add below you add the index.php file? You should write something in there,

 
  

You look at the configuration in fact TP is a lot of configuration, you do not thank the method, do a good job after the configuration to see the Welcome interface and then go down the face "".

It's wonderful, we should keep talking.

Take a thinkphp manual to see if you know.

Then in the same directory with the think file add below you add the index.php file? You should write something in there,

 
  

You look at the configuration in fact TP is a lot of configuration, you do not thank the method, do a good job after the configuration to see the Welcome interface and then go down the face "". Oh! I use thinkphp to do a few projects, these I still know, or thanks, after a multi-query, finally know the results, thinkphp official website has proposed here is a bug, see " Apache Server open URL rewrite removal index.php cause indexaction All methods cannot parse "

Take a thinkphp manual to see if you know.
After a multi-query, finally know the results, thinkphp official website has proposed here is a bug, see "apache Server open URL rewrite removal index.php cause indexaction All methods cannot parse"

  • 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.