这是我的route.php
std::wstring
在Somecontroller.php中,我想要这些参数,如
Route::get('test/{paramter1}/{paramter2}', 'Somecontroller@somemethod');
然后将$ val_1,$ val_2传递给数据库。
我该怎么做?
我尝试过使用它。但它没有用。
先谢谢你。
答案 0 :(得分:5)
你只需将它们作为someMethod的参数。
public function someMethod(Request $request, $paramter1, $paramter2)
{
// Your code here...
}
Laravel将完成剩下的工作。它在Controllers下的Laravel文档中有详细说明。
答案 1 :(得分:2)
请尝试以下操作。
Route::get('{x}/{y}', 'PagesController@index');
public function index($x, $y)
{
}