Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Details | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
991 lars 1
# Combining Modifiers
148 lars 2
 
3
You can apply any number of modifiers to a variable. They will be
4
applied in the order they are combined, from left to right. They must be
5
separated with a `|` (pipe) character.
6
 
991 lars 7
```php
8
<?php
148 lars 9
 
991 lars 10
$smarty->assign('articleTitle', 'Smokers are Productive, but Death Cuts Efficiency.');
11
```
148 lars 12
 
13
where template is:
14
 
991 lars 15
```smarty
16
{$articleTitle}
17
{$articleTitle|upper|spacify}
18
{$articleTitle|lower|spacify|truncate}
19
{$articleTitle|lower|truncate:30|spacify}
20
{$articleTitle|lower|spacify|truncate:30:". . ."}
21
```
148 lars 22
 
23
 
24
The above example will output:
25
 
991 lars 26
```
27
Smokers are Productive, but Death Cuts Efficiency.
28
S M O K E R S   A R ....snip....  H   C U T S   E F F I C I E N C Y .
29
s m o k e r s   a r ....snip....  b u t   d e a t h   c u t s...
30
s m o k e r s   a r e   p r o d u c t i v e ,   b u t . . .
31
s m o k e r s   a r e   p. . .
32
```