This site is built library CakePHP "Inflector" test site.
※ This site is using the CakePHP 1.2.6.
Enter the text you want to convert, "Send" button please.
The result of running Inflector
| Inflector::pluralize | party_types |
|---|---|
| Inflector::singularize | party_type |
| Inflector::camelize | PartyType |
| Inflector::underscore | party_type |
| Inflector::humanize | Party Type |
| Inflector::tableize | party_types |
| Inflector::classify | PartyType |
| Inflector::variable | partyType |
| Inflector::slug | party_type |
CakePHP Conventions
| model | ||
|---|---|---|
| Model Name | PartyType | UpperCamelCase,single Inflector::singularize(Inflector::classify($word)); |
| Model's FileName | party_type.php | underscored,lower,single Inflector::singularize(Inflector::slug(strtolower($word))).'.php'; |
| Table Name | party_types | underscored,lower,plural Inflector::pluralize(Inflector::slug(strtolower($word))); |
| controller | ||
|---|---|---|
| Controller Name | PartyTypes | UpperCamelCase,plural Inflector::pluralize(Inflector::classify($word)); |
| Controller's ClassName | PartyTypesController | UpperCamelCase,plural,with 'Controller' Inflector::pluralize(Inflector::classify($word)).'Controller'; |
| Controller's FileName | party_types_controller.php | underscored,lower,plural,with '_controller' Inflector::pluralize(Inflector::slug(strtolower($word))).'_controller.php'; |
| for uses | PartyType | Model Name Inflector::singularize(Inflector::classify($word)); |
| view | ||
|---|---|---|
| View Folder | party_types | underscored,lower,plural Inflector::pluralize(Inflector::slug(strtolower($word))); |
| View's FileName | party_type.php | underscored,lower,single Inflector::singularize(Inflector::slug(strtolower($word))).'.php'; |
"Inflector" is?
The Inflector class takes a string and can manipulate it to handle word variations such as pluralizations or camelizing and is normally accessed statically.Example:
Inflector::pluralize('example');
returns "examples".(From the official site)
References
- Inflector:: Library built various practical:: Manual:: 1.2 Collection:: The Cookbook
- Method of the class:: Inflector:: Library built various practical:: Manual:: 1.2 Collection:: The Cookbook
- Convenient to convert a string! CakePHP built-in library (Inflector) | Basharogu.
- Inflector class analysis. Terms of words on the changes - CPA-LAB technical
- Inflector bug? Watch vocabulary. Multiple changes are singular - CPA-LAB technical
- [Cakephp] Inflector methods Kke What happened? Notes | HappyQuality