Редакция 2 | Только различия | Учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS
Редакция 2 | Редакция 94 | ||
---|---|---|---|
1 | <?php
|
1 | <?php
|
2 | /**
|
2 | /**
|
3 | * Smarty plugin
|
3 | * Smarty plugin
|
4 | * @package Smarty
|
4 | * @package Smarty
|
5 | * @subpackage plugins
|
5 | * @subpackage plugins
|
6 | */
|
6 | */
|
7 | 7 | ||
8 | 8 | ||
9 | /**
|
9 | /**
|
10 | * Smarty plugin
|
10 | * Smarty plugin
|
11 | *
|
11 | *
|
12 | * Type: modifier<br>
|
12 | * Type: modifier<br>
|
13 | * Name: nl2br<br>
|
13 | * Name: nl2br<br>
|
14 | * Date: Feb 26, 2003
|
14 | * Date: Feb 26, 2003
|
15 | * Purpose: convert \r\n, \r or \n to <<br>>
|
15 | * Purpose: convert \r\n, \r or \n to <<br>>
|
16 | * Input:<br>
|
16 | * Input:<br>
|
17 | * - contents = contents to replace
|
17 | * - contents = contents to replace
|
18 | * - preceed_test = if true, includes preceeding break tags
|
18 | * - preceed_test = if true, includes preceeding break tags
|
19 | * in replacement
|
19 | * in replacement
|
20 | * Example: {$text|nl2br}
|
20 | * Example: {$text|nl2br}
|
21 | * @link http://smarty.php.net/manual/en/language.modifier.nl2br.php
|
21 | * @link http://smarty.php.net/manual/en/language.modifier.nl2br.php
|
22 | * nl2br (Smarty online manual)
|
22 | * nl2br (Smarty online manual)
|
23 | * @version 1.0
|
23 | * @version 1.0
|
24 | * @author Monte Ohrt <monte at ohrt dot com>
|
24 | * @author Monte Ohrt <monte at ohrt dot com>
|
25 | * @param string
|
25 | * @param string
|
26 | * @return string
|
26 | * @return string
|
27 | */
|
27 | */
|
28 | function smarty_modifier_nl2br($string) |
28 | function smarty_modifier_nl2br($string) |
29 | {
|
29 | {
|
30 | return nl2br($string); |
30 | return nl2br($string); |
31 | }
|
31 | }
|
32 | 32 | ||
33 | /* vim: set expandtab: */
|
33 | /* vim: set expandtab: */
|
34 | 34 | ||
35 | ?>
|
35 | ?>
|
36 | 36 |