[英]Need to transfer data from the table to another template
我有我的桌子:
<tbody>
@foreach($places as $place)
@if($place->place_info==0)
<tr>
<th scope="row"><input type="text">{{$place->id}}</th>
<td>{{$place->vagon_type}}</td>
<td>{{$place->place}}</td>
<td></td>
<td>
<button type="button" onclick="location.href='https://poizd/train_choose/place_choose/Ticket_form'"
class="btn btn-outline-primary btn-sm m-0 waves-effect">Купити
</button>
</td>
</tr>
@endif
@endforeach
</tbody>
單擊按鈕時,我需要將數據從另一個模板傳輸。 我該怎么做。
您不能在GET
方法中使用 out 參數將數據發送到另一個模板或通過POST
方法發送
onclick="location.href='https://poizd/train_choose/place_choose/Ticket_form'"
在 get 方法中,您可以在 url 末尾使用?param1=val1¶m2&val2
發送或從表單方法發送
<form method="post" action='https://poizd/train_choose/place_choose/Ticket_form'>
<input type="hidden" name="param1" value="val1">
<input type="hidden" name="param2" value="val2">
.
.
.
<button> send </button>
</form>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.