smarty template engine
Saturday, May 17, 2008  
download | documentation | faq | forum | mailing lists | changelog | contribs 


search for in the  


count_paragraphs

Este es usado para contar el número de parrafos en la variable.

Ejemplo 5-5. count_paragraphs

<?php

$smarty
->assign('articleTitle',
                 
"War Dims Hope for Peace. Child's Death Ruins Couple's Holiday.\n\n
                 Man is Fatally Slain. Death Causes Loneliness, Feeling of Isolation."
                
);

?>

Donde el template es:

{$articleTitle}
{$articleTitle|count_paragraphs}

Esta es la salida:

War Dims Hope for Peace. Child's Death Ruins Couple's Holiday.

Man is Fatally Slain. Death Causes Loneliness, Feeling of Isolation.
2

ver también count_characters, count_sentences y count_words.




 

credits 

Smarty Copyright © 2002-2008 New Digital Group, Inc.
All rights reserved.
Last updated: Tue Feb 12 09:11:42 2008 CST