HTMLHelper : Link With Image

CakePHP 11 July 2007 1 Comment



In Cakephp 1.1, if you want to display an image with a link, you’ll need to do something like this:

echo $html->link(
$html->image(‘myimage.jpg’),
‘/controller/action’,
array(),
null,
false
)

You need to tell CakePHP not to escape the content with last false statement. In CakePHP 1.2 you could do :

echo $html->link(
$html->image(‘myimage.jpg’),
‘/controller/action’,
array(‘escape’ => false)
)



  • http://zulia-footballmalaysia.blogspot.com Zulia

    I just learnt about blog. Now, I have lack of knowledge how to creat some link from other website. How to solve it?