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:
Este substituye todos los espacios repetidos, nuevas lineas y tabs por un unico espacio u otra cadena indicada.
Si usted quiere substituir bloques de texto de un template use la función {strip}.
Example 5.18. strip
<?php $smarty = new Smarty; $smarty->assign('articleTitle', "Grandmother of\neight makes\t hole in one."); $smarty->display('index.tpl'); ?>
Donde index.tpl es:
{$articleTitle} {$articleTitle|strip} {$articleTitle|strip:" "}
Esta es la Salida:
Grandmother of eight makes hole in one. Grandmother of eight makes hole in one. Grandmother of eight makes hole in one.