摘要: 【模型时间戳】 应用配置文件【不过一般不这样用】 // 自动写入时间戳字段 'auto_timestamp' => true, 【控制器块】namespace app\index\controller; use think\Controller;use app\index\model\App; cl 阅读全文
posted @ 2017-07-11 18:39 高锴 阅读(2024) 评论(0) 推荐(0) 编辑
摘要: namespace app\index\model; use think\Model; class App extends Model{ //自动完成[新增和修改时都会执行] protected $auto =[ 'time' //要验证的字段 ]; //新增时自动验证 protected $ins 阅读全文
posted @ 2017-07-11 16:47 高锴 阅读(2934) 评论(1) 推荐(0) 编辑
摘要: 【模型获取器】 【控制器块】namespace app\index\controller; use think\Controller;use app\index\model\App; class Index extends Controller{ public function index() { 阅读全文
posted @ 2017-07-11 16:15 高锴 阅读(1357) 评论(0) 推荐(1) 编辑
摘要: 几种调用模型的方法: use think\Controller; //use app\index\model\App; use think\Loader; class Index extends Controller{ public function index() { //$res = App:: 阅读全文
posted @ 2017-07-11 15:10 高锴 阅读(5671) 评论(0) 推荐(0) 编辑
摘要: Db::query();Db::execute(); Db::table()->select(); 所有数据,二维数组,结果不存在时返回空数组Db::table->find(); 一条数据,一维数组,结果不存在时返回NULL Db::table->value(); 一条数据, 结果不存在时返回空Db 阅读全文
posted @ 2017-07-11 11:58 高锴 阅读(1109) 评论(0) 推荐(0) 编辑
摘要: ul.nav>li*4>a[href=""]{菜单$$} sublime text 3快捷键 方法一:{block}{/block} 带可添加内容的坑的公共模板【common/base.html】<!DOCTYPE html><html><head> <meta charset="utf-8"/> 阅读全文
posted @ 2017-07-05 16:49 高锴 阅读(4627) 评论(0) 推荐(0) 编辑
摘要: 【switch方法】 {switch name="Think.get.level"} {case value="1|2"}<p>砖石会员</p>{/case} {case value="3"}<p>银牌会员</p>{/case} {case value="4"}<p>青铜会员</p>{/case} 阅读全文
posted @ 2017-07-05 15:08 高锴 阅读(3581) 评论(0) 推荐(0) 编辑
摘要: 比较标签 【等于】 1) {eq name="a" value="10"} 【和一个定值比较】 <p>相等</p> {else/} <p>不想等</p> {/eq} {eq name="a" value="$b"} 【两个变量比较】 <p>相等</p> {else/} <p>不想等</p> {/eq 阅读全文
posted @ 2017-07-05 15:07 高锴 阅读(3076) 评论(0) 推荐(0) 编辑
摘要: {volist}{/volist}标签遍历 【offset 开始遍历的地方】【length 遍历的长度,循环的次数】【mod 与当前数取余】【empty 为空时显示】【key 循环的次数】 <h1>这是view/index/index.html</h1> {volist name="list" id 阅读全文
posted @ 2017-07-05 10:24 高锴 阅读(11608) 评论(0) 推荐(0) 编辑
摘要: 获取系统变量 {$Think.service.HTTP_HOST} {$Think.env.PHP_STATUS} {$Think.session.email} {$Think.cookie.name} {$Think.get.id} {$Think.request.id} {$Think.post 阅读全文
posted @ 2017-07-05 09:41 高锴 阅读(1740) 评论(0) 推荐(0) 编辑