Property | Type | Description | |
---|---|---|---|
$_camelized | array | Contains a cache map of previously camelized words. | |
$_humanized | array | Contains a cache map of previously humanized words. | |
$_plural | Contains the list of pluralization rules. | ||
$_pluralized | array | Contains a cache map of previously pluralized words. | |
$_singular | Contains the list of pluralization rules. | ||
$_singularized | array | Contains a cache map of previously singularized words. | |
$_transliteration | array | Contains a default map of accented and special characters to ASCII characters. Can be extended or added to using Inflector::rules(). | |
$_underscored | array | Contains a cache map of previously underscored words. | |
$_uninflected | array | Indexed array of words which are the same in both singular and plural form. You can add rules to this list using Inflector::rules(). |
Method | Description | |
---|---|---|
camelize ( string $word, boolean $cased = true ) : string | Takes a under_scored word and turns it into a CamelCased or camelBack word | |
classify ( string $tableName ) : string | Takes a under_scored table name and returns corresponding class name. | |
humanize ( string $word, string $separator = '_' ) : string | Takes an under_scored version of a word and turns it into an human- readable form by replacing underscores with a space, and by upper casing the initial character. | |
pluralize ( string $word ) : string | Changes the form of a word from singular to plural. | |
reset ( ) | Clears local in-memory caches. Can be used to force a full-cache clear when updating inflection rules mid-way through request execution. | |
rules ( string $type, array $config = [] ) : mixed | Gets or adds inflection and transliteration rules. | |
singularize ( string $word ) : string | Changes the form of a word from plural to singular. | |
slug ( string $string, string $replacement = '-' ) : string | Returns a string with all spaces converted to given replacement and non word characters removed. Maps special characters to ASCII using Inflector::$_transliteration, which can be updated using Inflector::rules(). | |
tableize ( string $className ) : string | Takes a CamelCased class name and returns corresponding under_scored table name. | |
underscore ( string $word ) : string | Takes a CamelCased version of a word and turns it into an under_scored one. |
Method | Description | |
---|---|---|
_enclose ( string $string ) : string | Enclose a string for preg matching. |
public static reset ( ) |
public static singularize ( string $word ) : string | ||
$word | string | Word in plural form. |
return | string | Word in singular form. |
public static underscore ( string $word ) : string | ||
$word | string | CamelCased version of a word (i.e. `'RedBike'`). |
return | string | Under_scored version of the workd (i.e. `'red_bike'`). |
protected static array $_camelized | ||
return | array |
protected static array $_humanized | ||
return | array |
protected static $_plural |
protected static array $_pluralized | ||
return | array |
protected static $_singular |
protected static array $_singularized | ||
return | array |
protected static array $_transliteration | ||
return | array |
protected static array $_underscored | ||
return | array |
protected static array $_uninflected | ||
return | array |