Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
/**
4
 * Smarty plugin
5
 *
6
 * @package    Smarty
7
 * @subpackage PluginsModifierCompiler
8
 */
9
/**
10
 * Smarty nl2br modifier plugin
11
 * Type:     modifier
12
 * Name:     nl2br
13
 * Purpose:  insert HTML line breaks before all newlines in a string
14
 *
15
 * @link   https://www.smarty.net/docs/en/language.modifier.nl2br.tpl nl2br (Smarty online manual)
16
  *
17
 * @param array $params parameters
18
 *
19
 * @return string with compiled code
20
 */
21
function smarty_modifiercompiler_nl2br($params) {
22
    return 'nl2br((string) ' . $params[0] . ', (bool) ' . ($params[1] ?? true) . ')';
23
}