/**
* 获取 模块 控制器 方法名
*/
final protected function getTemplatePath()
{
list($class, $method) = explode('@', $this->request->route()->getActionName());
# 模块名
$this->modules = str_replace(
'\\',
'.',
str_replace(
'App\\Http\\Controllers\\',
'',
trim(
implode('\\', array_slice(explode('\\', $class), 0, -1)),
'\\'
)
)
);
# 控制器名称
$this->Controller = str_replace(
'Controller',
'',
substr(strrchr($class, '\\'), 1)
);
# 方法名
$this->method = $method;
}
laravel 获取 模块 控制器 方法名
最新推荐文章于 2022-04-13 20:37:32 发布