TP复习13
2014-02-28 14:42
246 查看
#
# ThinkPHP 3.1.2 模板的使用技巧
#
讲师:赵桐正
微博:http://weibo.com/zhaotongzheng
本节课大纲:
一、模板包含
<include file="完整模板文件名" />
<include file="./Tpl/default/Public/header.html" />
<include file="read" />
<include file="Public:header" />
<include file="blue:User:read" />
<include file="$tplName" />
<include file="header" title="ThinkPHP框架"keywords="开源WEB开发框架"/>
在模板中变量用[变量]接受
<include file='file1,file2' />
二、模板渲染
1、自动开启模板渲染 设置配置文件
'LAYOUT_ON'=>true,//开启模板渲染
准备一个模板渲染页面,在页面中使用{__CONTENT__}接受具体模板页面的内容
如果在摸一个具体模板中不希望使用渲染模板,可以在页首添加{__NOCONTENT__}
2、不开启自动模板渲染可以在每一个具体页面的页首添加
<layout name='layout'/>
三、模板的继承
'LAYOUT_ON'=>true,//开启模板渲染
# ThinkPHP 3.1.2 模板的使用技巧
#
讲师:赵桐正
微博:http://weibo.com/zhaotongzheng
本节课大纲:
一、模板包含
<include file="完整模板文件名" />
<include file="./Tpl/default/Public/header.html" />
<include file="read" />
<include file="Public:header" />
<include file="blue:User:read" />
<include file="$tplName" />
<include file="header" title="ThinkPHP框架"keywords="开源WEB开发框架"/>
在模板中变量用[变量]接受
<include file='file1,file2' />
二、模板渲染
1、自动开启模板渲染 设置配置文件
'LAYOUT_ON'=>true,//开启模板渲染
准备一个模板渲染页面,在页面中使用{__CONTENT__}接受具体模板页面的内容
如果在摸一个具体模板中不希望使用渲染模板,可以在页首添加{__NOCONTENT__}
2、不开启自动模板渲染可以在每一个具体页面的页首添加
<layout name='layout'/>
三、模板的继承
'LAYOUT_ON'=>true,//开启模板渲染
相关文章推荐
- PHP5.5新特性
- php中global和$GLOBALS[]的分析
- phpStrom添加插件:php文档生成(phpDocumentor)
- PHP的echo输出内容过多会很慢
- windows服务器php打开配置ssl
- PHP中常用的转义函数
- ThinkPHP初体验
- PHP判断一个请求是AJAX请求还是普通请求
- PHP消除bom的方法
- PHP中鲜为人知的10个函数
- TP复习12
- CakePHP之请求与响应对象
- PHP CURL模拟POST提交XML数据
- PHP 5.3.2 连接Mysql 数据库并查询表
- TP复习11
- TP复习10
- thinkphp显示重复两次
- PHP常见错误
- php入门学习书籍
- TP复习9