Get Smarty

Donate

Paypal

Smarty Icon

You may use the Smarty logo according to the trademark notice.

Smarty Template Engine Smarty Template Engine

For sponsorship, advertising, news or other inquiries, contact us at:

Sites Using Smarty

Advertisement

Get the juciest casino bonuses at this great website

If you are looking for great entertainment online, then we would like to recommend CasinoAdvisers.com. Find the best casino bonus available and much more that makes your casino experience much more enjoyable!

indent

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

パラメータの位置 必須 デフォルト 概要
1 integer No 4 インデントするキャラクタ数
2 string No (半角スペース 1 文字) インデントに使用するキャラクタ

Example 5.12. indent


<?php

$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.'
                );
?>

   

テンプレート


{$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.

   

stripwordwrap および spacify も参照してください。

Comments
No comments for this page.

Advertisement