Subversion-Projekte lars-tiefland.laravel_shop

Revision

Zur aktuellen Revision | Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
strip {#language.modifier.strip}
2
=====
3
 
4
This replaces all spaces, newlines and tabs with a single space, or with
5
the supplied string.
6
 
7
> **Note**
8
>
9
> If you want to strip blocks of template text, use the built-in
10
> [`{strip}`](#language.function.strip) function.
11
 
12
 
13
    <?php
14
    $smarty->assign('articleTitle', "Grandmother of\neight makes\t    hole in one.");
15
    $smarty->display('index.tpl');
16
    ?>
17
 
18
 
19
 
20
Where template is:
21
 
22
 
23
    {$articleTitle}
24
    {$articleTitle|strip}
25
    {$articleTitle|strip:'&nbsp;'}
26
 
27
 
28
 
29
Will output:
30
 
31
 
32
    Grandmother of
33
    eight makes        hole in one.
34
    Grandmother of eight makes hole in one.
35
    Grandmother&nbsp;of&nbsp;eight&nbsp;makes&nbsp;hole&nbsp;in&nbsp;one.
36
 
37
 
38
 
39
See also [`{strip}`](#language.function.strip) and
40
[`truncate`](#language.modifier.truncate).