0
<a href="../Public/singleproduct?id=<?php echo $row["Product"]["id"];?>">
<div class="single-products">
<div class="productinfo text-center myimg">
<?php echo $this->Html->image("product/".$row["Product"]["photo"]); ?>
<h2>Rs.<?php echo $row["Product"]["price"];?></h2>
<p><?php echo $row["Product"]["name"];?></p>
<a href="javascript:document.ff<?php echo ($i++);?>.submit()" class="btn btn-default add-to-cart"><i class="fa fa-shopping-cart"></i>Add to cart</a>
<?php echo $this->Session->flash('flash', array('element' => 'flash_notification')); ?>
</div>
</div>
</a>
此鏈接。CakePHP的:我怎麼能寫,因爲分頁這個網站<code><a href=""></a></code>將無法正常工作的其他網頁上使用分頁我需要在CakePHP的方式這個鏈接轉換CakePHP中
這是我認爲.ctp文件的所有代碼
<?php
$i=0;
foreach($product as $row)
{
?>
<form name="ff<?php echo $i;?>" method="post">
<input type="hidden" name="product_tbls_id" value="<?php echo $row["Product"]["id"];?>">
<input type="hidden" name="qty" value="1">
<div class="col-sm-4">
<div class="product-image-wrapper">
<a href="../Public/singleproduct?id=<?php echo $row["Product"]["id"];?>">
<div class="single-products">
<div class="productinfo text-center myimg">
<?php echo $this->Html->image("product/".$row["Product"]["photo"]); ?>
<h2>Rs.<?php echo $row["Product"]["price"];?></h2>
<p><?php echo $row["Product"]["name"];?></p>
<a href="javascript:document.ff<?php echo ($i++);?>.submit()" class="btn btn-default add-to-cart"><i class="fa fa-shopping-cart"></i>Add to cart</a>
<?php echo $this->Session->flash('flash', array('element' => 'flash_notification')); ?>
</div>
</div>
</a>
</div>
</div>
</form>
<?php
}
?>
我知道這個,但有div和div和其他鏈接,所以我不知道該怎麼做。請提及 – Vky
,並提及您嘗試過的內容。所以我們可以明白。 –
我想這樣[鏈接](http://stackoverflow.com/questions/13250788/cakephp-linking-the-whole-div)但那不是我的,所以我找不到我的解決方案。但嘗試 – Vky