[*] Class: Tools / toCamelCase
Change the name of the var to a correct name. Use the Tools method like strtolower, ucfirst and strtoupper.
This commit is contained in:
+6
-6
@@ -1422,14 +1422,14 @@ class ToolsCore
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Translates a string with underscores into camel case (e.g. first_name -> firstName)
|
* Translates a string with underscores into camel case (e.g. first_name -> firstName)
|
||||||
* @prototype string public static function toCamelCase(string $str[, bool $catapitalise_first_char = false])
|
* @prototype string public static function toCamelCase(string $str[, bool $capitalise_first_char = false])
|
||||||
*/
|
*/
|
||||||
public static function toCamelCase($str, $catapitalise_first_char = false)
|
public static function toCamelCase($str, $capitalise_first_char = false)
|
||||||
{
|
{
|
||||||
$str = strtolower($str);
|
$str = Tools::strtolower($str);
|
||||||
if ($catapitalise_first_char)
|
if ($capitalise_first_char)
|
||||||
$str = ucfirst($str);
|
$str = Tools:ucfirst($str);
|
||||||
return preg_replace_callback('/_+([a-z])/', create_function('$c', 'return strtoupper($c[1]);'), $str);
|
return preg_replace_callback('/_+([a-z])/', create_function('$c', 'return Tools::strtoupper($c[1]);'), $str);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user