smarty template engine
Friday, July 25, 2008  
download | documentation | faq | forum | mailing lists | changelog | contribs 


search for in the  


strip

Sostituisce tutte le sequenze di spazi, a capo e tabulatori con un singolo spazio o con la stringa fornita.

Nota: Se volete fare lo strip su blocchi di testo del template, usate la funzione strip.

Esempio 5-18. strip

<?php

$smarty 
= new Smarty;
$smarty->assign('articleTitle'"Grandmother of\neight makes\t    hole in one.");
$smarty->display('index.tpl');

?>

Dove index.tpl è:

{$articleTitle}
{$articleTitle|strip}
{$articleTitle|strip:"&nbsp;"}

Questo stamperà:

Grandmother of
eight makes        hole in one.
Grandmother of eight makes hole in one.
Grandmother&nbsp;of&nbsp;eight&nbsp;makes&nbsp;hole&nbsp;in&nbsp;one.



 

credits 

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

All rights reserved.