简体   繁体   English

如何用cakephp 1.3 html helper编写此代码?

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

i try to use gallery prettyphoto but i have problem with this code..how to write this code with cakephp 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>

The key part is to turn off HTML escaping for the link text (as it contains an HTML image tag). 关键部分是关闭链接文本的HTML转义(因为它包含HTML图像标签)。 Also, images are usually stored in the paths like /img/... but that will depend on your implementation. 同样,图像通常存储在/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