thinkphp5 tp5 获取模块名控制器名方法名

<?php
namespace app\index\controller;

use think\Db;
use think\Controller;
class Base extends Controller
{
    public function _initialize(){
        $no_check = array("login","login_check");
        $request = \think\Request::instance();
        echo $request->controller();
        echo $request->module();
        echo $request->action();
    }
}

 

posted @ 2017-12-23 20:46  西瓜霜  阅读(5906)  评论(0编辑  收藏  举报