修飾子
修飾子 | 書き方 | 仕様 |
---|---|---|
number_format | <{$member.point|number_format}> | 数字を3桁ごとにカンマ区切りで表示する。 |
cut_html | <{$item.description|cut_html:30}> | HTMLが含まれる文字列から、HTMLを削除して、指定した文字数にカットする。文字数は全角半角関係なく1文字として計算する。 |
count | <{if 5 < $new_item.list|@count}>5個より多くあります。<{/if}> | 配列の要素数を取得する。 使用例では新商品の配列に5個より多くデータが入ってれば「5個より多くあります。」と表示する。 |
nl2br | <{$item.description|nl2br}> | 文字列内の改行コードの前に< br >タグを追加する。 |
escape | <{$item.name|escape}> | "文字列内の以下の文字を変換する。 & → & " → " ' → ' < → < > → > <{$item.name|escape}>は <{$item.name|escape:html}>と同じ意味。 <{$item.name|escape:json}>とすると、文字列をjson文字列に変換する。" |