thinkphp模板的包含与渲染实例分析,thinkphp实例分析_PHP教程

WBOY
Release: 2016-07-13 10:12:55
Original
948 people have browsed it

thinkphp模板的包含与渲染实例分析,thinkphp实例分析

本文实例讲述了thinkphp模板的包含与渲染。分享给大家供大家参考。具体分析如下:

一、模板包含

复制代码代码如下:


//调用同级目录下的read模板




在模板中变量用[变量]接受
复制代码代码如下:

二、模板渲染

1、自动开启模板渲染 设置配置文件,替换文件中的特定内容,组装成完整页面.

复制代码代码如下:
'LAYOUT_ON'=>true,//开启模板渲染

在Public公共目录下,准备一个layout模板渲染页面,在页面中使用{__CONTENT__}引用具体模板页面的内容.

如果在一个具体模板中不希望使用渲染模板,可以在页首添加{__NOCONTENT__}

2、不开启自动模板渲染可以在每一个具体页面的页首添加

复制代码代码如下:

希望本文所述对大家的ThinkPHP框架程序设计有所帮助。

www.bkjia.com true http://www.bkjia.com/PHPjc/917678.html TechArticle thinkphp模板的包含与渲染实例分析,thinkphp实例分析 本文实例讲述了thinkphp模板的包含与渲染。分享给大家供大家参考。具体分析如下: 一...
Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!