| 148 |
lars |
1 |
indent {#language.modifier.indent}
|
|
|
2 |
======
|
|
|
3 |
|
|
|
4 |
This indents a string on each line, default is 4. As an optional
|
|
|
5 |
parameter, you can specify the number of characters to indent. As an
|
|
|
6 |
optional second parameter, you can specify the character to use to
|
|
|
7 |
indent with eg use `"\t"` for a tab.
|
|
|
8 |
|
|
|
9 |
Parameter Position Type Required Default Description
|
|
|
10 |
-------------------- --------- ---------- ------------- ---------------------------------------------------
|
|
|
11 |
1 integer No 4 This determines how many characters to indent to.
|
|
|
12 |
2 string No (one space) This is the character used to indent with.
|
|
|
13 |
|
|
|
14 |
|
|
|
15 |
<?php
|
|
|
16 |
|
|
|
17 |
$smarty->assign('articleTitle',
|
|
|
18 |
'NJ judge to rule on nude beach.
|
|
|
19 |
Sun or rain expected today, dark tonight.
|
|
|
20 |
Statistics show that teen pregnancy drops off significantly after 25.'
|
|
|
21 |
);
|
|
|
22 |
?>
|
|
|
23 |
|
|
|
24 |
|
|
|
25 |
|
|
|
26 |
Where template is:
|
|
|
27 |
|
|
|
28 |
|
|
|
29 |
{$articleTitle}
|
|
|
30 |
|
|
|
31 |
{$articleTitle|indent}
|
|
|
32 |
|
|
|
33 |
{$articleTitle|indent:10}
|
|
|
34 |
|
|
|
35 |
{$articleTitle|indent:1:"\t"}
|
|
|
36 |
|
|
|
37 |
|
|
|
38 |
|
|
|
39 |
Will output:
|
|
|
40 |
|
|
|
41 |
|
|
|
42 |
NJ judge to rule on nude beach.
|
|
|
43 |
Sun or rain expected today, dark tonight.
|
|
|
44 |
Statistics show that teen pregnancy drops off significantly after 25.
|
|
|
45 |
|
|
|
46 |
NJ judge to rule on nude beach.
|
|
|
47 |
Sun or rain expected today, dark tonight.
|
|
|
48 |
Statistics show that teen pregnancy drops off significantly after 25.
|
|
|
49 |
|
|
|
50 |
NJ judge to rule on nude beach.
|
|
|
51 |
Sun or rain expected today, dark tonight.
|
|
|
52 |
Statistics show that teen pregnancy drops off significantly after 25.
|
|
|
53 |
|
|
|
54 |
NJ judge to rule on nude beach.
|
|
|
55 |
Sun or rain expected today, dark tonight.
|
|
|
56 |
Statistics show that teen pregnancy drops off significantly after 25.
|
|
|
57 |
|
|
|
58 |
|
|
|
59 |
|
|
|
60 |
See also [`strip`](#language.modifier.strip),
|
|
|
61 |
[`wordwrap`](#language.modifier.wordwrap) and
|
|
|
62 |
[`spacify`](#language.modifier.spacify).
|