capitalize
パラメータの位置 | 型? | 必須 | デフォルト | 概要 |
1 | boolean? | No | false | 一ケタのワードを大文字にするかどうか |
変数内の全ての単語の先頭を大文字で開始します。
例 5-2. capitalize
<?php
$smarty = new Smarty;
$smarty->assign('articleTitle', 'next x-men film, x3, delayed.');
$smarty->display('index.tpl');
?>
index.tpl :
{$articleTitle}
{$articleTitle|capitalize}
{$articleTitle|capitalize:true}
出力:
next x-men film, x3, delayed.
Next X-Men Film, x3, Delayed.
Next X-Men Film, X3, Delayed.