equal
deleted
inserted
replaced
|
1 <?php |
|
2 /** |
|
3 * Smarty plugin |
|
4 * |
|
5 * @package Smarty |
|
6 * @subpackage PluginsModifierCompiler |
|
7 */ |
|
8 |
|
9 /** |
|
10 * Smarty lower modifier plugin |
|
11 * Type: modifier<br> |
|
12 * Name: lower<br> |
|
13 * Purpose: convert string to lowercase |
|
14 * |
|
15 * @link http://www.smarty.net/manual/en/language.modifier.lower.php lower (Smarty online manual) |
|
16 * @author Monte Ohrt <monte at ohrt dot com> |
|
17 * @author Uwe Tews |
|
18 * |
|
19 * @param array $params parameters |
|
20 * |
|
21 * @return string with compiled code |
|
22 */ |
|
23 |
|
24 function smarty_modifiercompiler_lower($params) { |
|
25 if (Smarty::$_MBSTRING) { |
|
26 return 'mb_strtolower(' . $params[0] . ', \'' . addslashes(Smarty::$_CHARSET) . '\')'; |
|
27 } |
|
28 // no MBString fallback |
|
29 return 'strtolower(' . $params[0] . ')'; |
|
30 } |