1

我如何在锂中结合链接和图像助手?我想要类似的东西:

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

我尝试了不同的选项,但似乎没有任何效果,我必须编写自己的助手吗?

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

1 回答 1

4

您应该转义 html 代码

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

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

于 2012-01-15T23:54:07.497 回答