Question

how can i combine the link and image helper in lithium? I want something like:

<a href="http://...">
    <img src="mypic.png" />
    And a title
</a>

I tried different options but nothing seems to work, do i have to write my own helper?

<?php
    $image = $this->html->image('mypic.png');
    echo $this->html->link('And a title', '', array('html' => $image));
?>
Was it helpful?

Solution

You should escape html code

 $image = $this->html->image('mypic.png');
 $this->html->link($image, $url, array('escape' => false))

http://li3.me/docs/lithium/template/helper/Html::link()

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top