Question

Comment puis-je combiner le lien et l'identité d'image au lithium? Je veux quelque chose comme:

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

J'ai essayé différentes options mais rien ne semble fonctionner, dois-je écrire mon propre aide?

<?php
    $image = $this->html->image('mypic.png');
    echo $this->html->link('And a title', '', array('html' => $image));
?>
Était-ce utile?

La solution

Vous devez échapper au code html

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

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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top