首页> 实战笔录 >PHP开发笔记 >ThinkPHP ThinkPHP
TP6报错:Non-static method think\Request::controller() should not be called statically
作者:小萝卜 2020-06-23 【 TP6 】 浏览 4307
简介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)