Pluralize and singularize English words.
Inflector pluralizes and singularizes English nouns. Used by CakePHP's naming conventions throughout the framework.
_cache( string $type , string $key , string $value false )
Cache inflected values, and return if already available
$type $key $value optional false stringcamelize( string $lowerCaseAndUnderscoredWord )
Returns the given lower_case_and_underscored_word as a CamelCased word.
$lowerCaseAndUnderscoredWord stringclassify( string $tableName )
Returns Cake model class name ("Person" for the database table "people".) for given database table.
$tableName stringhumanize( string $lowerCaseAndUnderscoredWord )
Returns the given underscored_word_group as a Human Readable Word Group. (Underscores are replaced by spaces and capitalized following words.)
$lowerCaseAndUnderscoredWord stringpluralize( string $word )
Return $word in plural form.
$word stringreset( )
Clears Inflectors inflected value caches. And resets the inflection rules to the initial values.
rules( string $type , array $rules , boolean $reset false )
Adds custom inflection $rules, of either 'plural', 'singular' or 'transliteration' $type.
Inflector::rules('plural', array('/^(inflect)or$/i' => '\1ables')); Inflector::rules('plural', array( 'rules' => array('/^(inflect)ors$/i' => '\1ables'), 'uninflected' => array('dontinflectme'), 'irregular' => array('red' => 'redlings') )); Inflector::rules('transliteration', array('/å/' => 'aa'));
$type $rules $reset optional false singularize( string $word )
Return $word in singular form.
$word stringslug( string $string , string $replacement '_' )
Returns a string with all spaces converted to underscores (by default), accented characters converted to non-accented characters, and non word characters removed.
$string $replacement optional '_' stringtableize( string $className )
Returns corresponding table name for given model $className. ("people" for the model class "Person").
$className stringunderscore( string $camelCasedWord )
Returns the given camelCasedWord as an underscored_word.
$camelCasedWord stringvariable( string $string )
Returns camelBacked version of an underscored string.
$string string
© 2005–2016 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
http://api.cakephp.org/2.7/class-Inflector.html