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|boolean $value false )
Cache inflected values, and return if already available
$type $key $value optional false string|booleancamelize( string $string , string $delimiter '_' )
Returns the input lower_case_delimited_string as a CamelCasedString.
$string $delimiter optional '_' stringclassify( string $tableName )
Returns Cake model class name ("Person" for the database table "people".) for given database table.
$tableName stringdasherize( string $string )
Returns the input CamelCasedString as an dashed-string.
Also replaces underscores with dashes
$string stringdelimit( string $string , string $delimiter '_' )
Expects a CamelCasedInputString, and produces a lower_case_delimited_string
$string $delimiter optional '_' stringhumanize( string $string , string $delimiter '_' )
Returns the input lower_case_delimited_string as 'A Human Readable String'. (Underscores are replaced by spaces and capitalized following words.)
$string $delimiter optional '_' 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', 'uninflected', 'irregular' or 'transliteration' $type.
Inflector::rules('plural', ['/^(inflect)or$/i' => '\1ables']); Inflector::rules('irregular', ['red' => 'redlings']); Inflector::rules('uninflected', ['dontinflectme']); Inflector::rules('transliteration', ['/å/' => '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 dashes (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 $string )
Returns the input CamelCasedString as an underscored_string.
Also replaces dashes with underscores
$string 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/3.1/class-Cake.Utility.Inflector.html