smarty template engine
Friday, May 16, 2008  
download | documentation | faq | forum | mailing lists | changelog | contribs 


search for in the  


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}.

Ejemplo 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.



 

credits 

Smarty Copyright © 2002-2008 New Digital Group, Inc.
All rights reserved.
Last updated: Tue Feb 12 09:11:42 2008 CST