Want to know what the inflector is going to do to your code, what the name of your model should be when you have a wierd table name? Just enter it in here and look at what cake will generate.
This is currently running on CakePHP
The output is what has happend for that particular method, and the other items in the array are the inflicted version being convered to other
types. eg pluralizing user becomes users and then camelizing users becomes Users. You can find problems with your table names and classes doing this
for example if you were to use a table called this cake would expect the model Thi by default.
When ever you pluralize something and then singularize it it should be the same. The following should generally give you the output true, if it does not you need to use some custom rules or use another name.
var_dump(Inflector::singularize(Inflector::pluralize($var)) === var_dump($var)) CakePHP's Inflector class seems to handle this word correctly
Convert models to controllers MyUser -> MyUsers
Inflector::pluralize($word); // CakePHPInflectorMagicsInflector::singularize($word); // CakePHPInflectorMagicConvert controllers to models MyUsers -> MyUser
Inflector::singularize($word); // CakePHPInflectorMagicInflector::pluralize($word); // CakePHPInflectorMagicsUsed with singularize to make tables into models my_users -> MyUsers
Inflector::camelize($word); // CakePHPInflectorMagicInflector::underscore($word); // cake_p_h_p_inflector_magicmodels to tables with the pluralize MyUser -> my_user
Inflector::underscore($word); // cake_p_h_p_inflector_magicInflector::camelize($word); // CakePHPInflectorMagicconvert models and controllers to human names MyUser -> My user
Inflector::humanize($word); // CakePHPInflectorMagicInflector::underscore($word); // cake_p_h_p_inflector_magicCalls underscore and pluralize to make model names MyUser -> my_user -> my_users
Inflector::tableize($word); // cake_p_h_p_inflector_magicsTable names to models my_users -> MyUser
Inflector::classify($word); // CakePHPInflectorMagicWas used for $this->set in 1.2 to make 'some_var' -> 'someVar'
Inflector::variable($word); // cakePHPInflectorMagicInflector::underscore($word); // cake_p_h_p_inflector_magicInflector::camelize($word); // CakePHPInflectorMagicRemove funny chars for a url
Inflector::slug($word); // CakePHPInflectorMagic