strip

Заменяет все повторные пробелы, новые строки и знаки табуляции на одиночный пробел или на заданную строку.

Замечание: Если вы хотите сделать аналогичную операцию над частью текста шаблона, то используйте функцию strip.

Пример 5-18. strip

index.php:

$smarty = new Smarty;
$smarty->assign('articleTitle', "Grandmother of\neight makes\t    hole in one.");
$smarty->display('index.tpl');

index.tpl:

{$articleTitle}
{$articleTitle|strip}
{$articleTitle|strip:" "}

OUTPUT:

Grandmother of
eight makes        hole in one.
Grandmother of eight makes hole in one.
Grandmother of eight makes hole in one.

HIVE: All information for read only. Please respect copyright!
Hosted by hive йца: йХЕБЯЙЮЪ ЦНПНДЯЙЮЪ АХАКХНРЕЙЮ