/* * http://127.0.0.1:8000/index?id=5 * hello_5 **/ Route::get(‘index/‘,function (){ return ‘hello_‘.$_GET[‘id‘]; }); /* * 控制器接收 ?(问号)参数 * http://127.0.0.1:8000/userGetRead?id=5 */ Route::get(‘userGetRead‘,‘UserController@getRead‘); C代码 public function getRead() { return ‘getRead_‘.$_GET[‘id‘]; }
原文:https://www.cnblogs.com/xfych/p/14764340.html