Home >Backend Development >PHP Tutorial >Thinkphp template inclusion and rendering example analysis, thinkphp example analysis_PHP tutorial

Thinkphp template inclusion and rendering example analysis, thinkphp example analysis_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:12:551020browse

Inclusion and rendering example analysis of thinkphp template, thinkphp example analysis

The example in this article describes the inclusion and rendering of thinkphp templates. Share it with everyone for your reference. The specific analysis is as follows:

1. Template contains

Copy code The code is as follows:


//Call the read template in the same directory




Use [variable] to accept variables in templates
Copy code The code is as follows:

2. Template rendering

1. Automatically turn on template rendering, set the configuration file, replace specific content in the file, and assemble a complete page.

Copy code The code is as follows:
'LAYOUT_ON'=>true,//Turn on template rendering

In the Public directory, prepare a layout template rendering page, and use {__CONTENT__} in the page to reference the content of the specific template page.

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

2. If you do not enable automatic template rendering, you can add
at the top of each specific page.

Copy code The code is as follows:

I hope this article will be helpful to everyone’s ThinkPHP framework programming.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/917678.htmlTechArticleExample analysis of the inclusion and rendering of thinkphp templates, thinkphp example analysis This article describes the inclusion and rendering of thinkphp templates. Share it with everyone for your reference. The specific analysis is as follows: 1...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn