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