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:
Заменяет все повторяющиеся пробелы, переводы строк и символы табуляции одним пробелом (или другой указанной строкой).
Если вы хотите обработать блоки текста в шаблоне аналогичным образом, воспользуйтесь функцией {strip}.
Example 5.18. strip
<?php $smarty->assign('articleTitle', "Grandmother of\neight makes\t hole in one."); ?>
Шаблон:
{$articleTitle} {$articleTitle|strip} {$articleTitle|strip:' '}
Результат обработки:
Grandmother of eight makes hole in one. Grandmother of eight makes hole in one. Grandmother of eight makes hole in one.