Get Smarty

Donate

Donate Bitcoin Bitcoin
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

Buy cheap glasses from Cheapglasses123.com and save up to 80%.

Where to buy prescription glasses? EyewearCanada.com is your best choice!

Where to buy discount wedding dresses and cheap smart dresses free shipping - Weddingdresstrend.com

Find Wedding Dresses Online at Canada from Ca-dress.com

Discount Wedding Dresses at EvWedding.com

soccer kp is New 2016 Nike Mercurial Superfly V soccer cleats from soccerkpkp.com

Advertisement

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.
Post a Comment
All comments are moderated. Support questions are ignored, use the forums instead.
Author:
Email: (not shown)
What is 20 plus 9? (Are you human?)

Advertisement