E' usato per contare il numero di parole contenute in una variabile.
Example 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
Comments