Get Smarty

Donate

Paypal

Smarty Icon

You may use the Smarty logo according to the trademark notice.

Smarty Template Engine Smarty Template Engine

For sponsorship, advertising, news or other inquiries, contact us at:

Sites Using Smarty

Advertisement

strip

Este substituye todos los espacios repetidos, nuevas lineas y tabs por un unico espacio u otra cadena indicada.

Nota

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:"&nbsp;"}

   

Esta es la Salida:


Grandmother of
eight makes        hole in one.
Grandmother of eight makes hole in one.
Grandmother&nbsp;of&nbsp;eight&nbsp;makes&nbsp;hole&nbsp;in&nbsp;one.

   

Comments
No comments for this page.

Advertisement