Looking to Build/Redesign a Website or Blog ?

To speak to Rakshit, call +91 968 704 2303

$html->link with html or image in CakePHP 1.2/1.3

Hello Friends,

Today i was working with $html->link in CakePHP 1.3. I need to show image and make a link on that image. If i use the $html->link and place the $html->img for link label than it display img html tag text and not showing the image. You can do it by defining escape to false. But syntax for defining 'escape'=>flase in CakePHP 1.3 is different. Look at below link or code which gives you idea about showing image or any html value in label of link.

echo $html->link($html->image("img1.gif"), "javascript:;", array('escape'=>false));

You need to define 'escape'=>false in html attribute array.   Similarly you can place any html element in place of $html->img .If you find any problem in this than let me know by comment.

Share:

6 Comments

Leave a Reply

Your email address will not be published.