首页> 实战笔录 >PHP开发笔记 >ThinkPHP ThinkPHP

TP6报错:Non-static method think\Request::controller() should not be called statically

作者:小萝卜 2020-06-23 浏览 3256

简介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)

文章评论

    高端网站建设