第一步 在database配置文件中开启 第二步 在需要测试的sql前,使用以下demo 这是因为数据库监听事件要提前开启,之后的sql才能开始监听的到
原创
2021-07-09 15:06:45
672阅读
thinkphp5的layout和以前的版本有点差异。 首先开启配置文件中的 'template' => [ 'layout_on' => true, // 'layout_name'=>'Public/layout' ] layout_on是开启layout,layout name是可以配置lay
原创
2022-04-08 11:26:09
401阅读
1.利用composer安装 composer create-project topthink/think=5.0.* tp5 --prefer-dist tp5下载的文件名 ...
转载
2021-08-10 13:52:00
327阅读
2评论
php报错PHP Warning: require(): open_basedir restriction in effect. File(/home/wwwroot/xxx.com/vendor/autoload.php) is not within the allowed path(s): (/home/wwwroot/xxx.com/public/:/tmp/:/proc/) in /ho
转载
2018-11-20 09:52:00
472阅读
2评论
Windows版安装a)使用composer create-project topthink/think testTG,来安装thi
原创
2022-08-18 12:01:59
253阅读
ThinkPHP5 隐藏index.php问题 thinkphp模板输出cookie,session中…
原创
2021-07-09 15:08:24
283阅读
混杂模式 $where = []; array_push($where, 'create_user_id=4 or create_user_id=17'); array_push($where, 'province like "山%"'); $where['city'] = array('=', '济南'); ...
原创
2021-08-13 01:01:54
494阅读
thinkphp5中如何使用 usort 一、总结 一句话总结:其实比较函数加上命名空间就好啦,不然找不到 1、php中usort的比较函数怎么写? 二、关于自定义比较函数 usort 如何使用 类中的方法(转) 转自:关于自定义比较函数 usort 如何使用 类中的方法 - qdujunjie的专
转载
2019-04-14 20:28:00
135阅读
它是对数据库的CURD操作事件进行了钩子,当事件触发时,会进行回调。 就像是注册事件和前置方法或后置方法类似 下面是demo 会看到在使用查询的同时执行了查询事件,打印出了 'this is query event ' ,并且先于print_r($user); 其中:回调函数中有两个参数:$opti
原创
2021-07-09 15:06:45
558阅读
git环境:Centos7.1参考了网上的一些教程,过程有点曲折。开始操作:1、用composer安装Swagger。机器上装的有宝塔面板,为了省事儿,直接用面板的shell执行安装Swagger的命令,curl -sS https://getcomposer.org/installer | phpmv composer.phar /usr/local/bin/composer我这边执行之后,结果
原创
2023-03-13 10:40:51
721阅读
thinkphp5 left join 一、总结 1、作用:left join就是即使不匹配也返回左表中的数据 2、join使用通式:object join ( mixed join [, mixed $condition = null [, string $type = 'INNER']] ) 弄
转载
2018-05-04 15:59:00
673阅读
thinkphp5内置标签 知道内置标签怎么用,查手册的时候好查 却功能的时候在里面找着来用 内置标签一览 记住名字是内置标签,然后找的时候好找,这些都是在视图或者模板页面调用 volist 这是标签的属性都是双引号,就是写在html页面的东西,双引号 比较标签 实例 if标签
转载
2018-04-16 23:27:00
221阅读
首先,要导入request包:use think\Request;thinkphp5 有三种方式获取 request// 第一种方式:Request::instance();public function getRequest2(){ // use think\Request; $request = Request::instance(); return dum...
原创
2022-01-09 17:45:59
809阅读
自己写的权限管理,大致思路:用户登陆成功之后,查出该用户的权限列表,并把权
原创
2023-04-26 10:40:00
272阅读