Google News
logo
CakePHP - Interview Questions
What is Inflector in CakePHP?
class Cake\Utility\Inflector

The Inflector class takes a string and can manipulate it to handle word variations such as pluralization or camelizing and is normally accessed statically. Example:
Inflector::pluralize('example') returns “examples”.
 
You can try out the inflections online at inflector.cakephp.org or sandbox.dereuromark.de.
 
Summary of Inflector Methods and Their Output : Quick summary of the Inflector built-in methods and the results they output when provided a multi-word argument :
Method Argument Output

pluralize()

BigApple

BigApples

big_apple

big_apples

singularize()

BigApples

BigApple

big_apples

big_apple

camelize()

big_apples

BigApples

big apple

BigApple

underscore()

BigApples

big_apples

Big Apples

big apples

humanize()

big_apples

Big Apples

bigApple

BigApple

classify()

big_apples

BigApple

big apple

BigApple

dasherize()

BigApples

big-apples

big apple

big apple

tableize()

BigApple

big_apples

Big Apple

big apples

variable()

big_apple

bigApple

big apples

bigApples

Advertisement