亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何使用 laravel 在引導模式中為每個 id 獲取動態數據?

如何使用 laravel 在引導模式中為每個 id 獲取動態數據?

慕村225694 2023-05-11 15:58:59
我正在開發一個應用程序,它需要在每次點擊我的不同圖標列表時顯示數據。問題是如何根據 id 在 bootstrap modal 中顯示數據。提前致謝。索引.blade.php 。<div class="col-md-3">     <button  type="button" class="btn btn-success " data-toggle="modal" data-target="#myModal" data-id="{{$post->id}}">Ajouter  </button> </div><div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="modelTitleId"  aria-hidden="true"><div class="modal-dialog modal-lg" role="document">            <div class="modal-content" >                <div class="modal-header">                    <h5 class="modal-title">Modal title</h5>                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">                        <span aria-hidden="true">&times;</span>                    </button>                </div>                <div class="modal-body" >                    <div class="container-fluid">                          <div class="row">                              <div class="col-md-12 ">                                 <div class="panel panel-default">                                    <div class="panel-heading text-center">Nouvelle annonce</div>                                         <div class=" form-group col-sm-6">                                            <img class="cart-img img-responsive" src="images/cover_image/{{$post->cover_image}}" alt="IMG-PRODUCT">                                         </div>
查看完整描述

2 回答

?
不負相思意

TA貢獻1777條經驗 獲得超10個贊

<button  type="button" class="btn btn-success " data-toggle="modal" data-target="#myModal{{$post->id}}" data-id="{{$post->id}}">Ajouter</button>

<div class="modal fade" id="myModal{{$post->id}}" tabindex="-1" role="dialog" aria-labelledby="modelTitleId" aria-hidden="true">

那對我有用


查看完整回答
反對 回復 2023-05-11
?
qq_遁去的一_1

TA貢獻1725條經驗 獲得超8個贊

我通過在 data-target 和 midel 中傳遞帖子 ID 來解決我的問題


    <button  type="button" class="btn btn-success " data-toggle="modal" data-target="#{{$post->id}}">Ajouter </button>


<div class="modal fade" id="{{$post->id}}" tabindex="-1" role="dialog" aria-labelledby="modelTitleId" aria-hidden="true">


查看完整回答
反對 回復 2023-05-11
  • 2 回答
  • 0 關注
  • 154 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號