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


search for in the  


count_sentences

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

Esempio 5-6. count_sentences

<?php
    
$smarty 
= new Smarty;
$smarty->assign('articleTitle''Two Soviet Ships Collide - One Dies. Enraged Cow Injures Farmer with Axe.');
$smarty->display('index.tpl');

?>

Dove index.tpl è:

{$articleTitle}
{$articleTitle|count_sentences}

Questo stamperà:

Two Soviet Ships Collide - One Dies. Enraged Cow Injures Farmer with Axe.
2



 

credits 

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

All rights reserved.