diff options
Diffstat (limited to 'vendor/smarty/smarty/docs/designers/language-modifiers/language-modifier-count-sentences.md')
-rw-r--r-- | vendor/smarty/smarty/docs/designers/language-modifiers/language-modifier-count-sentences.md | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/vendor/smarty/smarty/docs/designers/language-modifiers/language-modifier-count-sentences.md b/vendor/smarty/smarty/docs/designers/language-modifiers/language-modifier-count-sentences.md new file mode 100644 index 000000000..0a77ab82a --- /dev/null +++ b/vendor/smarty/smarty/docs/designers/language-modifiers/language-modifier-count-sentences.md @@ -0,0 +1,37 @@ +count\_sentences {#language.modifier.count.sentences} +================ + +This is used to count the number of sentences in a variable. A sentence +being delimited by a dot, question- or exclamation-mark (.?!). + + + <?php + + $smarty->assign('articleTitle', + 'Two Soviet Ships Collide - One Dies. + Enraged Cow Injures Farmer with Axe.' + ); + + ?> + + + +Where template is: + + + {$articleTitle} + {$articleTitle|count_sentences} + + + +Will output: + + + Two Soviet Ships Collide - One Dies. Enraged Cow Injures Farmer with Axe. + 2 + + + +See also [`count_characters`](#language.modifier.count.characters), +[`count_paragraphs`](#language.modifier.count.paragraphs) and +[`count_words`](#language.modifier.count.words). |