ThinkPhp5 方法注入
使用起来很简单
只需要在TP5 的Application目录中的common.php中编写代码即可
Request::hook("auth","getauth");
其中auth 为注入的方法名,
getauth 为common.php中的函数名.
使用也很简单.直接调用
$res = $this->request->auth();
dump($res);
即可
使用起来很简单
只需要在TP5 的Application目录中的common.php中编写代码即可
Request::hook("auth","getauth");
其中auth 为注入的方法名,
getauth 为common.php中的函数名.
使用也很简单.直接调用
$res = $this->request->auth();
dump($res);
即可