开发者

CakePHP - how to insert new line / line break in Html helper hyperlink

Using the CakePHP Html helper, how does one go about inserting a line break in the anchor text?

<?php echo $this->Html->link("My Anchor Text \n with new line", '/mycontroller/myaction'开发者_如何学Python); ?>

The above doesn't work.

Thanks...


You have to use the br tag for this purpose:

<?php echo $this->Html->link("My Anchor Text <br /> with new line", '/mycontroller/myaction', array('escape' => false)); ?>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜