|
|
|
|
| Smarty Manual |
|---|
| Prev | Chapter 5. Variable Modifiers | Next |
nl2br
All linebreaks will be converted to <br /> tags in the given
variable. This is equivalent to the PHP nl2br() function.
Example 5-13. nl2br
<?php
$smarty = new Smarty; $smarty->assign('articleTitle', "Sun or rain expected\ntoday, dark tonight"); $smarty->display('index.tpl');
?>
|
Where index.tpl is:
This should output:
Sun or rain expected<br />today, dark tonight |
|
|
|
|
|
|
|
|
|
Disclaimers: This
document is provided as free service for the benefits of Active-Venture.com's web hosting customers only. |
|
|
|
Quotes: So different are the colours of life, as we look forward to the future, or backward to the past; and so different the opinions and sentiments which this contrariety of appearance naturally produces, that the conversation of the old and young ends generally with contempt or pity on either side.
|
|
|
|
|