如何通过Route::controller
将参数传递给控制器?我想在我的控制器中传递一个参数user_id
到getCreate
的方法
Route::controller('account', 'ReportController', array(
'getCreate' => 'client.account.create',
'postStore' => 'client.account.store',
));
控制器
public function getCreate($user_id = null)
{
// need to do something here with $user_id
}
您只需使用用户id 调用您的url
www.mydomain.com/account/create/1