Convert Line breaks to html break for all field getters
Posted
by Ben
on Stack Overflow
See other posts from Stack Overflow
or by Ben
Published on 2010-05-06T00:31:24Z
Indexed on
2010/05/06
0:38 UTC
Read the original article
Hit count: 262
symfony
I currently have this:
<?php echo preg_replace('/\n/','<br />', $review->getComments()); ?>
and would very much like to be able to make all getters add html line breaks so i don't have to pepper my code with preg_replace. What is the best approach here?
© Stack Overflow or respective owner