zoukankan      html  css  js  c++  java
  • TP复习13

    #
    # 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,//开启模板渲染

     

     

  • 相关阅读:
    订单号设计
    小公司的技术架构原则
    Redis配置详解
    实现图片懒加载
    Js的GC机制
    防抖与节流
    Js中的堆栈
    浏览器窗口间通信
    块级格式化上下文
    实现瀑布流布局
  • 原文地址:https://www.cnblogs.com/wangchuang/p/3573596.html
Copyright © 2011-2022 走看看