簡體   English   中英

如何用cakephp 1.3 html helper編寫此代碼?

[英]how to write this code with cakephp 1.3 html helper?

我嘗試使用gallery prettyphoto,但此代碼有問題..如何使用cakephp html helper編寫此代碼

<li><a href="images/fullscreen/2.jpg" rel="prettyPhoto[gallery1]">
        <img src="images/thumbnails/t_2.jpg" width="60" height="60" alt="Nice building" /></a></li>

關鍵部分是關閉鏈接文本的HTML轉義(因為它包含HTML圖像標簽)。 同樣,圖像通常存儲在/img/...類的路徑中/img/...但這取決於您的實現。

<li><?php
$thumb = $this->Html->image('images/thumbnails/t_2.jpg', array(
    'width' => 60,
    'height' => 60,
    'alt' => 'Nice building',
));
echo $this->Html->link($thumb, 'images/fullscreen/2.jpg', array(
    'rel' => 'prettyPhoto[gallery1]',
    'escape' => false, // important
));
?></li>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM