摘要: 使用paginate()分页,我这里实现的是搜索后分页显示,翻页后传递搜索关键字 www.demo.com/home/search/?k=搜索关键字&page=2 搜索分页源码在: thinkphp/library/think/db/Query.php查看,thinkphp5的手册真是坑我这种彩笔。 阅读全文
posted @ 2019-08-02 09:22 文彬哦 阅读(9851) 评论(0) 推荐(0) 编辑
摘要: 怕忘了做个记录 链接:http://ecomfe.github.io/fontmin/#feature 特点:方便,快捷。 阅读全文
posted @ 2019-08-01 21:19 文彬哦 阅读(273) 评论(0) 推荐(0) 编辑
摘要: 模板中输出变量 默认不展示HTMl 使用raw将其中的中的HTMl内容展示出来 <div class="content"> <div class="content-left-box"> <p> {$view.contents|raw} </p> </div> 模板中输出变量 默认不展示HTMl 使用 阅读全文
posted @ 2019-05-25 09:25 文彬哦 阅读(4919) 评论(0) 推荐(0) 编辑
摘要: 看完就忘记录一下 正则: $roue = "/^1[3-9]\d{9}$/"; 前后/...... / 是正则必须的规则 ^1 : 手机号的必须是1开头 ^: 字符串开始的地方 [3-9] : 手机号的第二位可以是3-9的任意一位, 其中[]可以定义要匹配字符的范围,可以是[1-9]数字,也可以是[ 阅读全文
posted @ 2019-05-23 10:31 文彬哦 阅读(521) 评论(0) 推荐(0) 编辑
摘要: route下定义路由路径,如果是这种情况 'product'=>'home/product/index',//产品信息首页 'product/list'=>'home/product/list',//产品信息列表页 'product'=>'home/product/index',//产品信息首页 ' 阅读全文
posted @ 2019-05-21 09:07 文彬哦 阅读(460) 评论(0) 推荐(0) 编辑
摘要: 使用tp5的thinkphp-image类库处理图片 使用方法手册都有,为了增加印象我自己记录一下 手册:https://www.kancloud.cn/manual/thinkphp5/177530 我的需求是在app的管理后台上传压缩的图片 //图片压缩上传 public function up 阅读全文
posted @ 2019-03-30 14:44 文彬哦 阅读(3830) 评论(0) 推荐(0) 编辑
摘要: Call to a member function allowField() on null 在空对象上调用 allowField() 没有该模型对象无法调用,需要创建相应的模型 错误版本: if ($this->$model->allowField(true)->isUpdate($isUpdat 阅读全文
posted @ 2019-03-28 10:04 文彬哦 阅读(881) 评论(0) 推荐(0) 编辑
摘要: 根据多个id批量更新指定字段值 $map[] = ['id','in', input('post.id/a')]; $result = db('picture')->where($map)->update(['posid' => 1]); 相当于sql语句: UPDATE `yj_picture` 阅读全文
posted @ 2019-03-12 16:47 文彬哦 阅读(7060) 评论(0) 推荐(0) 编辑