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


Translate this page to:
search for in the


spacify

spacify は、変数の各キャラクタ間にスペースを挿入します。 第1パラメータには、挿入するキャラクタ(または文字列) を渡す事ができます。

パラメータの位置必須デフォルト概要
1stringNoone space変数の各キャラクタ間に挿入される要素

例 5-17. spacify

<?php

$smarty
->assign('articleTitle''Something Went Wrong in Jet Crash, Experts Say.');

?>

テンプレート

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

出力

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

wordwrap および nl2br も参照ください。



[advertise]


credits 

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

All rights reserved.