Minor optimization on Inflector::variable

This commit is contained in:
Mark Story 2009-12-16 19:23:29 -05:00
parent aa3a197b26
commit c8297ff283

View file

@ -481,7 +481,7 @@ class Inflector extends Object {
function variable($string) { function variable($string) {
$string = Inflector::camelize(Inflector::underscore($string)); $string = Inflector::camelize(Inflector::underscore($string));
$replace = strtolower(substr($string, 0, 1)); $replace = strtolower(substr($string, 0, 1));
return preg_replace('/\\w/', $replace, $string, 1); return $replace . substr($string, 1);
} }
/** /**
* Returns a string with all spaces converted to underscores (by default), accented * Returns a string with all spaces converted to underscores (by default), accented