count_words[count words]
count_words[计算词数]
test.php:
$smarty = new Smarty;
$smarty->assign('articleTitle', 'Dealers Will Hear Car Talk at Noon.');
$smarty->display('test.html');
test.html:
{$articleTitle}
{$articleTitle|count_words}
输出:
Dealers Will Hear Car Talk at Noon.
7