smarty template engine
Friday, August 08, 2008  
download | documentation | faq | forum | mailing lists | changelog | contribs 


search for in the  


indent

Posizione del ParametroTipoObbligatorioDefaultDescrizione
1interoNo4Stabilisce di quanti caratteri deve essere l'indentazione.
2stringaNo(uno spazio)Questo è il carattere usato per l'indentazione.

Questo modificatore effettua un'indentazione della stringa ad ogni riga, per default di 4 caratteri. Come parametro opzionale si può specificare di quanti caratteri deve essere l'indentazione. Si può indicare anche, come secondo parametro opzionale, quale carattere usare per l'indentazione (usare "\t" per il tabulatore).

Esempio 5-11. indent

<?php
    
$smarty 
= new Smarty;
$smarty->assign('articleTitle''NJ judge to rule on nude beach.
Sun or rain expected today, dark tonight.
Statistics show that teen pregnancy drops off significantly after 25.'
);
$smarty->display('index.tpl');

?>

Dove index.tpl è:

{$articleTitle}

{$articleTitle|indent}

{$articleTitle|indent:10}

{$articleTitle|indent:1:"\t"}

Questo stamperà:

NJ judge to rule on nude beach.
Sun or rain expected today, dark tonight.
Statistics show that teen pregnancy drops off significantly after 25.

    NJ judge to rule on nude beach.
    Sun or rain expected today, dark tonight.
    Statistics show that teen pregnancy drops off significantly after 25.

          NJ judge to rule on nude beach.
          Sun or rain expected today, dark tonight.
          Statistics show that teen pregnancy drops off significantly after 25.

        NJ judge to rule on nude beach.
        Sun or rain expected today, dark tonight.
        Statistics show that teen pregnancy drops off significantly after 25.



 

credits 

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

All rights reserved.