ThinkPHP框架 Thinkphp中CLI模式下接收参数的几种方式 一、argv 方式 php test.php news 1 5 //变量仅在 register_argc_argv 打开时可用。 print_r($argc); /... 2021年01月11日 阅读 46 °C 发表评论 阅读全文
ThinkPHP框架 Thinkphp6多应用模式:按照应用去处理异常 方法 1、文件路径: app/Request.php <?php namespace app; // 应用请求对象类 class Request extends \... 2020年07月04日 阅读 170 °C 发表评论 阅读全文
ThinkPHP框架 ThinkPHP伪静态规则(Apache、IIS 、Nginx ) 伪静态规则的好处就是:可以通过URL重写隐藏应用的入口文件 index.php。 由于ThinkPHP版本很多,例如:3.x、5.x、6.x。我这里以... 2020年04月14日 阅读 1,629 °C 发表评论 阅读全文
ThinkPHP框架 ThinkPHP6“分页url额外参数无效”的解决办法 1、简洁分页 $list = Db::name('user')->where('status',1)->order('id', 'desc')->... 2020年03月31日 阅读 366 °C 发表评论 阅读全文
ThinkPHP框架 thinkphp自定义“更新数据库配置”函数功能 更新数据库配置, (事例基于thinkphp5.0); 亲测可用! //更新数据库配置 public function update_dbconfig() { $d... 2020年02月14日 阅读 112 °C 4 阅读全文
ThinkPHP框架 Indirect modification of overloaded element of think\Collection has no effect 解决方法 背景: 我在进行查询并循环时候报错如下: Indirect modification of overloaded element of think\Collecti... 2020年01月03日 阅读 410 °C 发表评论 阅读全文
ThinkPHP框架 Thinkphp5 + 百度编辑器自定义上传 教程 1、百度编辑器官方下载sdk; 2、在引入编辑器页面,写入js: // 百度编辑器 UE.Editor.prototype._bkGetActionU... 2019年11月24日 阅读 113 °C 发表评论 阅读全文
ThinkPHP框架 failed to open stream:No such file or directory 原因及解决方法 今天一位朋友自己在宝塔搭建Thinkphp,结果访问域名首页的时候,直接报如下错误: Warning:require(D:\wwwroot/thinkphp/sta... 2019年07月31日 阅读 22,248 °C 2 阅读全文
ThinkPHP框架 ThinkPHP5.1 + endroid/qrcode 二维码生成教程 Composer链接: https://packagist.org/packages/endroid/qrcode 注意:PHP版本 要求 7.1+ ... 2019年03月03日 阅读 2,208 °C 1 阅读全文
ThinkPHP框架 ThinkPHP隐藏后台登录入口地址方法 相信很多的PHP程序员都用过ThinkPHP框架开发过项目。以ThinkPHP5版本举例,我们都知道后台“www.test.com/admin“是我们最常用的登录入... 2019年03月01日 阅读 3,138 °C 发表评论 阅读全文
ThinkPHP框架 ThinkPHP5开发API接口“定义全局异常处理”教程 1、新建文件夹以及文件 路径: /application/lib/exception/ExceptionHandler.php 并写入以下代码: <?php ... 2018年12月05日 阅读 530 °C 发表评论 阅读全文
ThinkPHP框架 微信小程序+thinkphp5用户登陆,返回第三方3rd_session代码实例 服务器环境: centos7、php7.0; 准备工作: 1、注册小程序,并获取 appid 、appsecret 2、下载微信解密算法sdk : h... 2018年02月19日 阅读 1,659 °C 发表评论 阅读全文
ThinkPHP框架 微信小程序+thinkphp5获取微信运动数据 代码实例 配置文件: <?php // +---------------------------------------------------------------... 2018年02月19日 阅读 351 °C 发表评论 阅读全文
PHP open_basedir restriction in effect. 原因与解决方法 今天一位朋友在linux服务器部署thinkphp5的时候PHP报了这个错误,如下: Warning: require(): open_basedir restri... 2017年11月21日 阅读 23,126 °C 4 阅读全文
ThinkPHP框架 ThinkPHP3.2 动态切换数据库方法 1、config 配置: 'connection' => 'mysql://root:[email protected]:3306/dbname', connect... 2017年11月05日 阅读 913 °C 2 阅读全文
ThinkPHP框架 nginx配置Thinkphp5“支持pathinfo()与隐藏index.php文件“方法 虽然说网上有很多文章都在说nginx支持TP5的pathinfo,但是真正适合所有人用的又有几个?我今天分析一个nginx配置文件支持pathinfo和隐藏inde... 2017年10月07日 阅读 3,463 °C 2 阅读全文