上一页 1 2 3 4 5 6 7 8 9 10 ··· 12 下一页
摘要: 在控制器类里面定义前置方法 protected $beforeActionList = [ 'first' => ['only' => 'second,third'] ]; 不管是在调用second()还是调用third()方法,都会在执行之前调用first()方法 protected functi 阅读全文
posted @ 2020-02-23 14:27 一颗糊涂淡 阅读(557) 评论(0) 推荐(0) 编辑
摘要: 重写Handel的render()方法 <?php namespace app\lib\exception; use Exception; use think\exception\Handle; use think\facade\Log; class ExceptionHandle extends 阅读全文
posted @ 2020-02-21 11:18 一颗糊涂淡 阅读(1980) 评论(0) 推荐(0) 编辑
摘要: 当前有两个版本 路由设置 Route::get('api/:version/banner/:id', 'api/:version.Banner/getBanner'); Version:1 地址 zerg.so/api/v1/banner/1 返回 "this is v1 version" Vers 阅读全文
posted @ 2020-02-17 15:11 一颗糊涂淡 阅读(771) 评论(0) 推荐(0) 编辑
摘要: <?php namespace app\index\controller; class Index { public function userlist() { $list = model('User')->paginate( 2, false, [ 'type' => 'Bootstrap', ' 阅读全文
posted @ 2020-02-12 21:50 一颗糊涂淡 阅读(545) 评论(0) 推荐(0) 编辑
摘要: 这里只是个人记录用的~~~ 1.生成项目composer create-project topthink/think=5.1.* tp5(tp5为文件夹名 也就是项目名)2.生成模块php think build --module admin3.生成控制器php think make:control 阅读全文
posted @ 2020-02-12 12:54 一颗糊涂淡 阅读(185) 评论(0) 推荐(0) 编辑
摘要: index控制器--从数据库获取值 <?php namespace app\index\controller; class Index { public function api($title = '') { if (!$title) { $data = model('Shici')->find() 阅读全文
posted @ 2020-01-04 21:16 一颗糊涂淡 阅读(543) 评论(0) 推荐(0) 编辑
摘要: js $('#addbtn').click(function () { var form = document.getElementById("img-form");//获取表单的数据 var formdata = new FormData(form);//格式化表单数据 console.log(f 阅读全文
posted @ 2020-01-03 21:31 一颗糊涂淡 阅读(1628) 评论(0) 推荐(0) 编辑
摘要: 分类添加方法 模型文件中的方法 //创建一个静态方法,获取分类 /** * Undocumented function * * @param integer $pid 当前父ID * @param array $result 引用返回值 * @param integer $blank 设置分类之间的 阅读全文
posted @ 2020-01-03 10:29 一颗糊涂淡 阅读(1001) 评论(0) 推荐(1) 编辑
摘要: 浏览网页的时候,会遇到某些想要复制的文字不能选中 我们如果想要实现这个效果,只需要对包含这部分文字的标签设置一个css属性 user-select:none 但是低版本的IE浏览器无效,想要实现这个效果,可以用标签属性onselectstart="return false;"来实现 这样写,页面显示 阅读全文
posted @ 2019-09-10 14:08 一颗糊涂淡 阅读(3177) 评论(0) 推荐(0) 编辑
摘要: bootstrap的栅格系统用于通过row与column的组合来布局页面布局 row必须包含在 container 或 container-fluid 中 使用bootstrap要先引入bootstrap的css和js文件,jquery文件,bootstrap是基于jquery的框架,所以在引入bo 阅读全文
posted @ 2019-09-10 13:38 一颗糊涂淡 阅读(150) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 12 下一页