Kill Lei Dog---thinkphp----13 front-ends separation and navigation separation

Source: Internet
Author: User

We are in the actual development of the site is often the beginning and the beginning of the separation, and TP This is also very user-friendly, he left us an include tag can be directly introduced to the tail and the site.

The site we are going to do is, of course, no exception, separated from the tail:

We first use the browser code to view the plug-in analysis of the art to prepare the source:

, here is clearly divided into 3 parts, because most of the site head and tail are basically consistent, so we also use TP to reserve the label for us, we first go back to the Home view directory to create a folder called public, mainly used to place our site head and tail part:

Here we'll split the tail and back parts of the code and put it here:

And then go back to our Home View folder.

They are then directly introduced into the month via the include tag:

And the controller does not need to fill out what the site can be normal access:

The success of the separation, then the left here also has a navigation, and the content in each page is also displayed, then we casually will he also separated out good:

Then create a gps.html in the public directory to store:

Then you can solve the problem by following the same question:

The test results are fully displayed:

Kill Lei Dog---thinkphp----13 front-ends separation and navigation separation

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.