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
# spacify
148 lars 2
 
3
`spacify` is a way to insert a space between every character of a
4
variable. You can optionally pass a different character or string to
5
insert.
6
 
991 lars 7
## Basic usage
8
```smarty
9
{$myVar|spacify}
10
```
148 lars 11
 
991 lars 12
## Parameters
148 lars 13
 
991 lars 14
| Parameter Position | Type   | Required | Default     | Description                                                     |
15
|--------------------|--------|----------|-------------|-----------------------------------------------------------------|
16
| 1                  | string | No       | *one space* | This what gets inserted between each character of the variable. |
148 lars 17
 
991 lars 18
## Examples
148 lars 19
 
991 lars 20
```php
21
<?php
148 lars 22
 
991 lars 23
$smarty->assign('articleTitle', 'Something Went Wrong in Jet Crash, Experts Say.');
148 lars 24
 
991 lars 25
```
26
 
148 lars 27
Where template is:
28
 
991 lars 29
```smarty
30
{$articleTitle}
31
{$articleTitle|spacify}
32
{$articleTitle|spacify:"^^"}
33
```
148 lars 34
 
35
Will output:
36
 
991 lars 37
```
38
Something Went Wrong in Jet Crash, Experts Say.
39
S o m e t h i n g   W .... snip ....  s h ,   E x p e r t s   S a y .
40
S^^o^^m^^e^^t^^h^^i^^n^^g^^ .... snip .... ^^e^^r^^t^^s^^ ^^S^^a^^y^^.
41
```
148 lars 42
 
991 lars 43
See also [`wordwrap`](language-modifier-wordwrap.md) and
44
[`nl2br`](language-modifier-nl2br.md).