From 51609351f2c4b5082b7e6f0744cd3811c325303f Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 11 Oct 2016 14:01:29 +0200 Subject: * initial template --- lib/smarty/plugins/modifiercompiler.lower.php | 31 +++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 lib/smarty/plugins/modifiercompiler.lower.php (limited to 'lib/smarty/plugins/modifiercompiler.lower.php') diff --git a/lib/smarty/plugins/modifiercompiler.lower.php b/lib/smarty/plugins/modifiercompiler.lower.php new file mode 100644 index 0000000..1845cc1 --- /dev/null +++ b/lib/smarty/plugins/modifiercompiler.lower.php @@ -0,0 +1,31 @@ + + * Name: lower
+ * Purpose: convert string to lowercase + * + * @link http://www.smarty.net/manual/en/language.modifier.lower.php lower (Smarty online manual) + * @author Monte Ohrt + * @author Uwe Tews + * @param array $params parameters + * @return string with compiled code + */ + +function smarty_modifiercompiler_lower($params, $compiler) +{ + if (Smarty::$_MBSTRING) { + return 'mb_strtolower(' . $params[0] . ', \'' . addslashes(Smarty::$_CHARSET) . '\')' ; + } + // no MBString fallback + return 'strtolower(' . $params[0] . ')'; +} + +?> \ No newline at end of file -- cgit v1.2.3