请教:控制器无法获取请求参数

浏览:233 发布日期:2019/11/06 分类:ThinkPHP6专区
请求:http://tp6.io/index.php/account/login/index/name/test 不行而
http://tp6.io/index.php/account/login/index/name?test,就可以。
public function __construct(Request $request)
{
$this->request = $request;
}
//默认入口
public function index(){
return $this->request->param('name');
//return $this->login($this->request);
}
最佳答案
评论( 相关
后面还有条评论,点击查看>>