thinkphp template include and render instance analysis, thinkphp instance Analysis _php Tutorial

Source: Internet
Author: User

thinkphp template Inclusion and rendering example analysis, thinkphp instance analysis


The examples in this article describe the inclusion and rendering of thinkphp templates. Share to everyone for your reference. The specific analysis is as follows:

First, the template contains
Copy the Code code as follows:

Call the read template under the sibling directory




Variables are accepted in the template by [variable]
Copy the Code code as follows:

Second, template rendering

1, automatically open the template rendering settings configuration file, replace the specific content in the file, assembled into a full page.
Copy the Code Code as follows: ' layout_on ' =>true,//turn on template rendering

In the public common directory, prepare a Layout template rendering page, using {__content__} in the page to refer to the content of the specific template page.

If you do not want to use a render template in a specific template, you can add {__nocontent__} at the top of the page

2, do not turn on automatic template rendering can be added at the top of each page
Copy the Code code as follows:

It is hoped that this article will be helpful to everyone's thinkphp framework design.

http://www.bkjia.com/PHPjc/917678.html www.bkjia.com true http://www.bkjia.com/PHPjc/917678.html techarticle thinkphp template containing and rendering instance analysis, thinkphp instance analysis This article describes the thinkphp template's inclusion and rendering. Share to everyone for your reference. The specific analysis is as follows: one ...

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