tp5学习思考

路由

tp5不再支持普通路由的访问,如果在route.php配置文件中,添加路由规则

Route::rule('nihao/[:name]','nihao');

index控制器nihao方法如下

public function nihao(Request $request,$name = 'World')
    {
       echo 'url:'.$request->url().'<br/>';
       return 'hello '.$name;
    }

通过http://www.tp52.com/nihao?name=ff访问,

获取不到name参数的值

原文地址:https://www.cnblogs.com/Mr-fhl/p/8109717.html