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
The code is as follows:
Call the read template under the sibling directory
Variables are accepted in the template by [variable]
The code is 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.
The code is 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
The code is as follows:
It is hoped that this article will be helpful to everyone's thinkphp framework design.