0
因此,在我的索引頁上,我列出了模型中的所有行和一些字段,單擊按鈕我希望模式能夠與該按鈕對應的行中的所有數據一起彈出至。Yii2在按鈕上單擊傳遞ID以使用ajax渲染部分
所以在按鈕上單擊我想讓ajax調用渲染局部視圖,這將需要我在進行ajax調用時傳遞該項目的ID。
<div class="col-sm-3 small-item">
<div class="inner-wrapper">
<img src="<?= $model->featured_img; ?>" class="img-responsive"/>
<div class="overlay">
<h4><?= $model->title; ?></h4>
<p><?= $model->sub_title; ?></p>
<a data-toggle="modal" data-target="#modal" class="btnsolid-sm btn-black">View Full Data</a> //this is the button that when clicked the popup should appear with all the related data
</div>
</div>
</div>