tp5.0
$request= \think\Request::instance();
$module = $request->module();//模块名
$controller = $request->controller();//控制器名
$action = $request->action()//方法名
//ps::获取到的值要与对应的路径组成部分大小写保持一致
tp5.1
在5.1版本中Request类没有instance方法,我们可以通过Facade特性直接静态化调用,具体如下:
use think\facade\Request;
$module = Request::module();
$controller = Request::controller();
$action = Request::controller();