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

    #
    # ThinkPHP 3.1.2 模板中的基本语法
    #
    讲师:赵桐正
    微博:http://weibo.com/zhaotongzheng

    本节课大纲:
    一、导入CSS和JS文件
    1、css link
    js scr
    <link rel='stylesheet' type='text/css' href='__PUBLIC__/Css/test.css'/>
    <script src='__PUBLIC__/Js/test.js'></script>
    2.import
    <import type='js' file='Js.test' /> //导入Public文件夹下面的Js目录中的test.js文件,import标签可以省略type属性,默认就是js的
    <import type='css' file='Css.test' />
    //可以更改默认文件夹 设置basepath属性
    <import type='js' file='Js.my' basepath='./Other'/>
    3.load
    //方法可以自动检测导入的文件类型
    <load href='__PUBLIC__/Js/test.js' />
    二、分支结构
    1、if
    <if condition='$sex eq "男"'>
    男人是泥巴做的
    <else />
    女人是水做的
    </if>

    <if condition='$age lt 18'>
    未成年
    <elseif condition='$age eq 18'/>
    青春年少
    <else />
    成年
    </if>
    > gt
    < lt
    == eq
    <= elt
    >= egt
    != neq
    === heq
    !== nheq

    <switch name='number'>
    <case value='1'>一个和尚挑水吃</case>
    <case value='2'>两个和尚台水吃</case>
    <case value='3'>三个和尚没水吃</case>
    <default/> 这里是默认值
    </switch>
    三、循环结构
    四、特殊标签
    五、其他标签使用

  • 相关阅读:
    NOIP2016 蚯蚓 题解
    BZOJ 1294 围豆豆 题解
    POJ1852 Ants 题解
    BZOJ 1131 [POI2008] STA-Station 题解
    HDU 5963 朋友 题解
    Codeforces 1292C Xenon's Attack on the Gangs 题解
    Emergency Evacuation 题解
    P4408 逃学的小孩 题解
    UVA11300 Spreading the Wealth 题解
    P2882 Face The Right Way G 题解
  • 原文地址:https://www.cnblogs.com/wangchuang/p/3573355.html
Copyright © 2011-2022 走看看