首页> 实战笔录 >PHP开发笔记 >ThinkPHP ThinkPHP
TP6报错:Non-static method think\Request::controller() should not be called statically
作者:小萝卜 2020-06-23 【 TP6 】 浏览 5284
简介TP6报错:Non-static method think\Request::controller() should not be called statically
问题描述:
在TP6中使用request获取当前控制器名称时报错了:Non-static method think\Request::controller() should not be called statically
解决办法:
引入request框架文件
use think\facade\Request;
很赞哦! (0)
相关文章
- tp5 上传文件时怎么让他不自动生成子文件夹?
- tp5动态创建mysql数据表
- tp5实现文件下载,并对下载的文件重命名
- tp6表单验证提交之后报错Call to a member function set() on null
- TP3.2输入验证和I方法使用
- tp5判断一张数据表是否存在
- TP6使用Jwt验证token时报错Cannot pass parameter 3 by reference
- TP6 Validate内置验证规则总览
- TP6定义常量报错:Use of undefined constant CONTROLLER_NAME - assumed 'CONTROLLER_NAME'
- TP6 TP5一键生成sitemap站点地图 代码分享
