5  * @subpackage PluginsModifierCompiler
 
   9  * Smarty lower modifier plugin
 
  13  * Purpose:  convert string to lowercase
 
  15  * @link http://smarty.php.net/manual/en/language.modifier.lower.php lower (Smarty online manual)
 
  16  * @author Monte Ohrt <monte at ohrt dot com> 
 
  18  * @param array $params parameters
 
  19  * @return string with compiled code
 
  22 function smarty_modifiercompiler_lower($params, $compiler)
 
  24     if (function_exists('mb_strtolower')) {
 
  25         return '((mb_detect_encoding(' . $params[0] . ', \'UTF-8, ISO-8859-1\') === \'UTF-8\') ? mb_strtolower(' . $params[0] . ',SMARTY_RESOURCE_CHAR_SET) : strtolower(' . $params[0] . '))' ;
 
  27         return 'strtolower(' . $params[0] . ')';