Quantcast
Channel: [SMD] - 8L0G5PH3R3 » Web Development
Viewing all articles
Browse latest Browse all 10

HTMLHelper : Link With Image

$
0
0

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)
)


Viewing all articles
Browse latest Browse all 10

Trending Articles