thinkphp path mode and program run route

Source: Internet
Author: User

In thinkphp, there are four main types of views, namely 1, Normal mode, 2: Path mode, 3: Override mode, 4: Compatibility mode.

In the beginning of the development of the learning process, it is recommended to use the path mode, when the production, the use of rewrite mode, so here first mainly talk about the path mode:

Here is a copy of my own:


How you understand the path pattern is relatively clear, as you will certainly ask, ask what not to specify the view file of the parent directory, this problem I should not be anxious to solve, because in the back of the study will be the primary key know, and, even if you know what to ask, will not understand its true essence.

When we get here, I have to say that if I send this request to the browser to get the whole process of this view page, though I have said it once before, but, each time the understanding is not the same freshness, I understand the runtime so:

First, the browser makes the request, and then the server receives the request, the first thing to do is not to find which page, but to find the import file, request any frame of the file to pass through the portal file, then from the import file to get a variety of information will be executed according to its specifications, of course, This process will also run to the configuration file inside to read the configuration, when these foreplay is completed, then began to find our module, the corresponding direct kill to our controller, in the controller, this is equivalent to our to, there is a processing and distribution of the role, here we did not explain the processing, only with $this-> Display (); It is possible to complete the assignment, about his distribution, this is the TP of the total specification, like Zend, this is relatively good understanding some, he will be the default point to it; with the controller class name as a folder under the method name of the view file so that a point, and thus, We asked for this page.


thinkphp path mode and program run route

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.