smarty template engine
Thursday, July 29, 2010  
download | documentation | faq | forum | mailing lists | changelog | contribs 


Translate this page to:
search for in the


nl2br

Semua pemisah baris "\n" akan diubah ke tag html <br /> dalam variabel yang disediakan. Ini sama dengan fungsi PHP nl2br().

Teladan 5-14. nl2br

<?php

$smarty
->assign('articleTitle',
                
"Sun or rain expected\ntoday, dark tonight"
                
);

?>

Di mana template adalah:

{$articleTitle|nl2br}

Akan memperlihatkan:

Sun or rain expected<br />today, dark tonight

Lihat juga word_wrap, count_paragraphs dan count_sentences.



[advertise]


credits 

Smarty Copyright © 2002-2008
New Digital Group, Inc.

All rights reserved.