|
|

|
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:" "} |
Questo stamperà:
Grandmother of
eight makes hole in one.
Grandmother of eight makes hole in one.
Grandmother of eight makes hole in one. |
|
|
|
|