top-think / think-multi-app

thinkphp6 multi app support

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

thinkPHP6.0 开启多应用后无法获取控制器和方法名,返回空值

felixwann opened this issue · comments

打印Request对象:

dd($this->request);

image

解决办法:

$routeName = $this->request->rule()->getName();
$routeName = explode('@', $routeName);
$controllerName = $routeName[0];
$actionName = $routeName[1];
dump($controllerName, $actionName);

image

https://www.cnblogs.com/felixwan/p/16948909.html