$_plural
$_plural : array
Plural inflector rules
Pluralize and singularize English words.
Inflector pluralizes and singularizes English nouns. Used by CakePHP's naming conventions throughout the framework.
rules(string $type, array $rules, boolean $reset = false) : void
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']);
string | $type | The type of inflection, either 'plural', 'singular', 'uninflected' or 'transliteration'. |
array | $rules | Array of rules to be added. |
boolean | $reset | If true, will unset default inflections for all new rules that are being defined in $rules. |
humanize(string $string, string $delimiter = '_') : string
Returns the input lower_case_delimited_string as 'A Human Readable String'.
(Underscores are replaced by spaces and capitalized following words.)
string | $string | String to be humanized |
string | $delimiter | the character to replace with a space |
Human-readable string
slug(string $string, string $replacement = '-') : string
Returns a string with all spaces converted to dashes (by default), accented characters converted to non-accented characters, and non word characters removed.
string | $string | the string you want to slug |
string | $replacement | will replace keys in map |
_cache(string $type, string $key, string|boolean $value = false) : string|false
Cache inflected values, and return if already available
string | $type | Inflection type |
string | $key | Original value |
string|boolean | $value | Inflected value |
Inflected value on cache hit or false on cache miss.
None found |
Loading…