link or other HTML help开发者_开发百科er functions?" />
开发者

cakephp clean html output

开发者 https://www.devze.com 2023-03-02 18:11 出处:网络
How to add \"\\n\" always after when i use $html->link or other HTML help开发者_开发百科er functions?

How to add "\n" always after when i use $html->link or other HTML help开发者_开发百科er functions? I add in AppHelper but doesn't work. I usen CakePHP 1.3


The Html helper doesn't allow you to append text to element output. Your best bet is to use separate echo statements instead of using a code block. For example, instead of

<?php
echo $this->Html->link('Link 1', '/foo');
echo $this->Html->link('Link 2', '/bar');
?>

use

<?php echo $this->Html->link('Link 1', '/foo'); ?>
<?php echo $this->Html->link('Link 2', '/bar'); ?>

See http://book.cakephp.org/view/1435/Inserting-Well-Formatted-elements for Html helper documentation and examples.

0

精彩评论

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

关注公众号