Inflector
Joomla Framework String Inflector Class
The Inflector transforms words
| since |
1.0 |
|---|---|
| deprecated |
5.0 Use doctrine/inflector package as complete replacement instead. |
| package |
Joomla Framework |
Methods
addCountableRule
Adds a countable word.
addCountableRule( data) :
| since |
1.0 |
|---|
Arguments
- data
mixedA string or an array of strings to add.
Response
$this
addRule
Adds inflection regex rules to the inflector.
addRule( data, ruleType) :
| since |
1.0 |
|---|---|
| throws |
|
Arguments
- data
mixedA string or an array of strings or regex rules to add.- ruleType
stringThe rule type: singular | plural | countable
Response
void
camelize
Proxy for Inflector::camelize()
camelize( word) :
Arguments
- word
string
Response
string
classify
Proxy for Inflector::classify()
classify( word) :
Arguments
- word
string
Response
string
isCountable
Checks if a word is countable.
isCountable( word) :
| since |
1.0 |
|---|
Arguments
- word
stringThe string input.
Response
boolTrue if word is countable, false otherwise.
isPlural
Checks if a word is in a plural form.
isPlural( word) :
| since |
1.0 |
|---|
Arguments
- word
stringThe string input.
Response
boolTrue if word is plural, false if not.
isSingular
Checks if a word is in a singular form.
isSingular( word) :
| since |
1.0 |
|---|
Arguments
- word
stringThe string input.
Response
boolTrue if word is singular, false if not.
pluralize
Proxy for Inflector::pluralize()
pluralize( word) :
Arguments
- word
string
Response
string
reset
Empty method to suffice the former interface
reset() :
Response
void
rules
Empty method to suffice the former interface
rules( type, mixed||string|int rules, reset = false) :
Arguments
- type
string- rules
iterable<string|int, mixed>- reset
bool
Response
void
singularize
Proxy for Inflector::singularize()
singularize( word) :
Arguments
- word
string
Response
string
tableize
Proxy for Inflector::tableize()
tableize( word) :
Arguments
- word
string
Response
string
ucwords
Proxy for Inflector::ucwords()
ucwords( string, delimiters = " -") :
Arguments
- string
string- delimiters
string
Response
string
Properties
countable
The inflector rules for countability.
| since |
2.0.0 |
|---|
Type(s)
array<string|int, mixed>