Thinkphp template includes and rendering instance analysis, and thinkphp instance analysis. Thinkphp template inclusion and rendering instance analysis, thinkphp instance analysis this article describes the examples of thinkphp template inclusion and rendering. Share it with you for your reference. The specific analysis is as follows: a thinkphp template includes and rendering instance analysis, thinkphp instance analysis
This article describes the thinkphp template's inclusion and rendering. Share it with you for your reference. The specific analysis is as follows:
I. template inclusion
The code is as follows:
// Call the read template under the same directory
In the template, the variables are accepted using [variables ].
The code is as follows:
II. Template rendering
1. automatically enable the template rendering settings configuration file, replace the specific content in the file, and assemble it into a complete page.
The code is as follows:
'Layout _ on' => true, // enable template rendering
In the Public directory, prepare a layout template to render the page, and use {__ CONTENT __} to reference the CONTENT of the specific template page in the page.
If you do not want to use a rendering template in a specific template, you can add {__ NOCONTENT __} on the top __}
2. if you do not enable automatic template rendering, you can add
The code is as follows:
I hope this article will help you with ThinkPHP framework programming.
Examples in this article describes the thinkphp template's inclusion and rendering. Share it with you for your reference. The specific analysis is as follows: 1...