smarty template engine
Thursday, July 29, 2010  
download | documentation | faq | forum | mailing lists | changelog | contribs 


Translate this page to:
search for in the


spacify

Posição do ParâmetroTipoRequeridoPadrãoDescrição
1stringNãoum espaçoO que é inserido entre cada caractere da variável.

Insere um espaço entre cada caractere de uma variável. Você pode opcionalmente passar um caractere (ou uma string) diferente para inserir.

Exemplo 5-17. spacify

index.php:

$smarty = new Smarty;
$smarty->assign('articleTitle', 'Something Went Wrong in Jet Crash, Experts Say.');
$smarty->display('index.tpl');

index.tpl:

{$articleTitle}
{$articleTitle|spacify}
{$articleTitle|spacify:"^^"}

OUTPUT:

Something Went Wrong in Jet Crash, Experts Say.
S o m e t h i n g   W e n t   W r o n g   i n   J e t   C r a s h ,   E x p e r t s   S a y .
S^^o^^m^^e^^t^^h^^i^^n^^g^^ ^^W^^e^^n^^t^^ ^^W^^r^^o^^n^^g^^ ^^i^^n^^ ^^J^^e^^t^^ ^^C^^r^^a^^s^^h^^,^^ ^^E^^x^^p^^e^^r^^t^^s^^ ^^S^^a^^y^^.


[advertise]


credits 

Smarty Copyright © 2002-2008
New Digital Group, Inc.

All rights reserved.