![](/img/trans.png)
[英]“Cannot modify header information - headers already sent by” error.How to redirect upon successful submission of the form
[英]variable not sent to controller upon form submission in Laravel
以下是我的回報:
return redirect()->route('account', ['key' => 1]);
接下來是嘗試使用上述關鍵變量的刀片代碼:
<input type = "key" name = "key" id="key" value="{{$key}}">
路線:
Route::get('/account', [
'uses' => 'UserController@getAccount',
'as' => 'account'
]);
我不確定為什么在提交表單時沒有發送 1 的值。
代替
input type="key"
至
input type="hidden"
另外,制作這樣的路線:
Route::get('/account/{key}', [
'uses' => 'UserController@getAccount',
'as' => 'account'
]);
它應該可以工作
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.