thinkphp templates include, Render, inherit

Source: Internet
Author: User

First, the template contains
<include file= "full template file name"/>
<include file= "./tpl/default/public/header.html"/>
<include file= "read"/>
<include file= "Public:header"/>//Do not need the public module as long as this folder can be
<include file= "Blue:User:read"/>
<include file= "$tplName"/>
<include file= "header" title= "thinkphp framework" keywords= "open source Web development framework"/>
Variables are accepted in the template by [variable]
<include file= ' File1,file2 '/>
second, template rendering in the manual template engine-template layout layout.html to the template folder and the module folder sibling
1. Automatically turn on the template rendering settings configuration file
' layout_on ' =>true,//turn on template rendering
Prepare a template rendering page and use {__content__} on the page to accept the content of the specific template page
If you don't 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
<layout name= ' layout '/>
3. Tips for use
The contents of other template files can also be used in the render template file
<include file= ' Public:header '/>
<body>
<p> here is the rendering page!!! </p>
{__content__}
</body>
Iii. Inheritance of templates

thinkphp templates include, Render, inherit

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.