smarty template engine
Tuesday, October 07, 2008  
download | documentation | faq | forum | mailing lists | changelog | contribs 


search for in the  


count_words

E' usato per contare il numero di parole contenute in una variabile.

Esempio 5-7. count_words

<?php
    
$smarty 
= new Smarty;
$smarty->assign('articleTitle''Dealers Will Hear Car Talk at Noon.');
$smarty->display('index.tpl');

?>

Dove index.tpl è:

{$articleTitle}
{$articleTitle|count_words}

Questo stamperà:

Dealers Will Hear Car Talk at Noon.
7



 

credits 

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

All rights reserved.