smarty template engine
Saturday, May 17, 2008  
download | documentation | faq | forum | mailing lists | changelog | contribs 


search for in the  


nl2br

Todas as quebras de linha serão convertidas para <br /> na variável data. Isto é equivalente a função nl2br() do PHP.

Exemplo 5-14. nl2br

index.php:

$smarty = new Smarty;
$smarty->assign('articleTitle', "Sun or rain expected\ntoday, dark tonight");
$smarty->display('index.tpl');

index.tpl:

{$articleTitle|nl2br}

MOSTRA:

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



 

credits 

Smarty Copyright © 2002-2008 New Digital Group, Inc.
All rights reserved.
Last updated: Tue Feb 12 09:11:29 2008 CST