10 defined(
'JPATH_PLATFORM') or die;
43 public static function fromCamelCase($input, $grouped =
false)
46 ? preg_split(
'/(?<=[^A-Z_])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][^A-Z_])/x', $input)
47 : trim(preg_replace(
'#([A-Z])#',
' $1', $input));
59 public static function toCamelCase($input)
62 $input = self::toSpaceSeparated($input);
63 $input = ucwords($input);
64 $input = str_ireplace(
' ',
'', $input);
78 public static function toDashSeparated($input)
81 $input = preg_replace(
'#[ \-_]+#',
'-', $input);
95 public static function toSpaceSeparated($input)
98 $input = preg_replace(
'#[ \-_]+#',
' ', $input);
112 public static function toUnderscoreSeparated($input)
115 $input = preg_replace(
'#[ \-_]+#',
'_', $input);
129 public static function toVariable($input)
132 $input = self::toSpaceSeparated($input);
133 $input = self::toCamelCase($input);
136 $input = preg_replace(
'#^[0-9]+.*$#',
'', $input);
139 $first = substr($input, 0, 1);
140 $first = strtolower($first);
143 $input = substr_replace($input, $first, 0, 1);
157 public static function toKey($input)
160 $input = self::toUnderscoreSeparated($input);
161 $input = strtolower($input);