结合链接&图片

时间:2012-01-15 14:22:59

标签: lithium

如何将锂链接和图像助手组合在一起?我想要这样的东西:

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

1 个答案:

答案 0 :(得分: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()

相关问题