thinkphp的文件引用与分析结构
一、导入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' /)//默认是Public文件夹 //可以更改默认文件夹 设置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 lt == eq < = elt > = egt != neq === heq !== nheq (switch name = 'number' )//循环中要把变量的$符号去掉 (case value = '1' )一个和尚挑水吃(/case) (case value = '2' )两个和尚台水吃(/case) (case value = '3' )三个和尚没水吃(/case) (default/) 这里是默认值 (/switch)查看更多关于thinkphp的文件引用与分析结构 - Thinkphp的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did6280