Thinkphp5.1版本相对5.0版本升级了很多地方。

比如我们在Thinkphp5.0中通过以下方法可以获取当前访问的模块名、控制器名、方法名:

use thinkRequest;

$module = Request::instance()->module();
$controller = Request::instance()->controller();
$action = Request::instance()->controller();

而在5.1版本中Request类没有instance方法,我们通过Facade特性可以直接静态化调用,具体如下:

use thinkfacadeRequest;

$module = Request::module();
$controller = Request::controller();
$action = Request::controller();