Skip to content
Umakant Patil edited this page Aug 14, 2017 · 1 revision

Used to count the number of paragraphs in a variable.

Template:

{$articleTitle = 'War Dims Hope for Peace. Child's Death Ruins Couple's Holiday.\n\nMan is Fatally Slain. Death Causes Loneliness, Feeling of Isolation.'}

{$articleTitle|count_paragraphs}

output:

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

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

see also count_paragraphs in PHP Smarty documentation.

Clone this wiki locally