cakephp clean html output
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.
精彩评论