【发布时间】:2018-05-31 12:10:40
【问题描述】:
我的观点刀片.....
tableHtml += "<td><a href= '{{url('/add')}}/" + data.hits[i].recipe.label + "'> add to favotite</a></td>";
当我点击添加到收藏时....我在 url 中得到这个
http://localhost/lily/public/add/Chilli%20Green%20Salad
web.php
Route::get('/add', 'HomeController@add');
如何在控制器中获取 url 传递名称.....
public function add(Request $request)
{
$request->get("") ////////////how can i get the string i passed on url
}
【问题讨论】: