私は機能を作っていますが、クイックビューボタンをクリックすると、その製品についての情報を持っているモーダルが開かれますが、これを行う方法はわかりませんメソッドが動作していないので、私を助けてください。codeigniter行の情報を得る方法
これが私の見解です:
<div class="row">
<h4>Feauture Product</h4>
</div>
<form method="post">
<div class="row">
<div class="product">
<?php foreach ($infolist as $info_key){ ?>
<div class="col-sm-6 col-md-3">
<div class="thumbnail">
<a href="<?php echo base_url();?>index.php/product/viewpd/<?php echo $info_key->id; ?>"><img src="http://wingsacessorios.com.br/public/img/vertical/img-home05.jpg" class="img-responsive"></a>
<div class="caption">
<h5 class="text-justify">Name product: <?php echo $info_key->name; ?></h5>
<p class="text-justify">Price: <?php echo $info_key->price.' VNĐ'; ?></p>
<p class="text-center"> <a href="javascript:;" onclick="tocart(<?php echo $info_key->id ?>)" class="btn btn-success" data-toggle="modal" data-target=".bs-example-modal-sm" ><i class="fa fa-cart-arrow-down" aria-hidden="true"></i> Buy Now</a><a href="#" class="btn btn-danger" role="button" data-toggle="modal" data-target="#myModal"><i class="fa fa-eye" aria-hidden="true"></i> Quick View</a></p>
</div>
</div>
</div>
<?php }?>
</div>
<!-- Small modal alert when click add cart -->
<div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
<div class="modal-dialog modal-sm" role="document">
<div class="modal-content">
<div class="modal-header" style="padding:5px 10px 5px 10px;">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel" style="background-color:transparent;color:#000000;">Alert from website !</h4>
</div>
<div class="modal-body">
<h5>Added product to your cart!</h5>
</div>
</div>
</div>
</div>
<!-- Modal quickview -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
</div>
<div class="modal-body">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
iの各ループのためにモーダルクイックビューコードを置けば、それはちょうどあなたが開く必要があります上のあなたが持っているものを開くには、最初の製品
<?php foreach(...):?> '' <?php endforeach;を使用することをお勧めします。 (PHPとHTMLが混在する)テンプレートコードでは、読みやすさのために '<?php foreach(...){?>' ''の代わりに? – DLight
私は以下の答えでそれを変更しましたが、言及するのを忘れました。誰のためにも良いリマインダー。 –