What is Smarty?
Why use it?
Use Cases and Work Flow
Syntax Comparison
Template Inheritance
Best Practices
Crash Course
You may use the Smarty logo according to the trademark notice.
For sponsorship, advertising, news or other inquiries, contact us at:
Подсчитывает количество предложений в переменной.
Example 5.6. count_sentences
<?php $smarty->assign('articleTitle', 'Two Soviet Ships Collide - One Dies. Enraged Cow Injures Farmer with Axe.' ); ?>
Шаблон:
{$articleTitle} {$articleTitle|count_sentences}
Результат обработки:
Two Soviet Ships Collide - One Dies. Enraged Cow Injures Farmer with Axe. 2
См. также count_characters, count_paragraphs и count_words.