アットウィキロゴ
smarty @Wiki
掲示板 掲示板 ページ検索 ページ検索 メニュー メニュー

smarty @Wiki

indent

最終更新:

匿名ユーザー

- view
だれでも歓迎! 編集

indent

パラメータの位置 型? 必須 デフォルト 概要
1 integer? No 4 インデントするキャラクタ数
2 string? No (one space) インデントに使用するキャラクタ

各行で文字列をインデントします。デフォルトは4です。
第1パラメータには、インデントするキャラクタ数が 指定できます。第2パラメータには、インデントに使用するキャラクタが指定できます。(タブは"\t")

例 5-11. indent

<?php
$smarty = new Smarty;
$smarty->assign('articleTitle', 'NJ judge to rule on nude beach.
Sun or rain expected today, dark tonight.
Statistics show that teen pregnancy drops off significantly after 25.');
$smarty->display('index.tpl');
?>
index.tpl : 
{$articleTitle}

{$articleTitle|indent}

{$articleTitle|indent:10}

{$articleTitle|indent:1:"\t"}
出力 : 
NJ judge to rule on nude beach.
Sun or rain expected today, dark tonight.
Statistics show that teen pregnancy drops off significantly after 25.

   NJ judge to rule on nude beach.
   Sun or rain expected today, dark tonight.
   Statistics show that teen pregnancy drops off significantly after 25.

         NJ judge to rule on nude beach.
         Sun or rain expected today, dark tonight.
         Statistics show that teen pregnancy drops off significantly after 25.

       NJ judge to rule on nude beach.
       Sun or rain expected today, dark tonight.
       Statistics show that teen pregnancy drops off significantly after 25.
最近更新されたスレッド
人気記事ランキング
ウィキ募集バナー