Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

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