smarty template engine
Saturday, May 17, 2008  
download | documentation | faq | forum | mailing lists | changelog | contribs 


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 も参照ください。




 

credits 

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