[ Index ] |
|
Code source de PHPonTrax 2.6.6-svn |
[Code source] [Imprimer] [Statistiques]
File containing the Inflector class (PHP 5)
Copyright: | (c) 2005 John Peterson |
Version: | $Id: inflector.php 201 2006-05-25 08:58:10Z john $ |
Poids: | 212 lignes (7 kb) |
Inclus ou requis: | 1 fois |
Référencé: | 0 fois |
Nécessite: | 1 fichier vendor/trax/inflections.php |
Inflector:: (12 méthodes):
pluralize()
singularize()
capitalize()
camelize()
underscore()
humanize()
titleize()
dasherize()
tableize()
classify()
foreign_key()
ordinalize()
pluralize($word) X-Ref |
Pluralize a word according to English rules Convert a lower-case singular word to plural form. param: string $word Word to be pluralized return: string Plural of $word |
singularize($word) X-Ref |
Singularize a word according to English rules param: string $word Word to be singularized return: string Singular of $word |
capitalize($word) X-Ref |
Capitalize a word making it all lower case with first letter uppercase param: string $word Word to be capitalized return: string Capitalized $word |
camelize($lower_case_and_underscored_word) X-Ref |
Convert a phrase from the lower case and underscored form to the camel case form param: string $lower_case_and_underscored_word Phrase to return: string Camel case form of the phrase |
underscore($camel_cased_word) X-Ref |
Convert a phrase from the camel case form to the lower case and underscored form param: string $camel_cased_word Phrase to convert return: string Lower case and underscored form of the phrase |
humanize($lower_case_and_underscored_word) X-Ref |
Generate a more human version of a lower case underscored word param: string $lower_case_and_underscored_word A word or phrase in return: string The input value with underscores replaced by |
titleize($word) X-Ref |
Convert a word or phrase into a title format "Welcome To My Site" param: string $word A word or phrase return: string A string that has all words capitalized and splits on existing caps. |
dasherize($underscored_word) X-Ref |
Convert a word's underscores into dashes param: string $underscored_word Word to convert return: string All underscores converted to dashes |
tableize($class_name) X-Ref |
Convert a class name to the corresponding table name The class name is a singular word or phrase in CamelCase. By convention it corresponds to a table whose name is a plural word or phrase in lower case underscore form. param: string $class_name Name of {@link ActiveRecord} sub-class return: string Pluralized lower_case_underscore form of name |
classify($table_name) X-Ref |
Convert a table name to the corresponding class name param: string $table_name Name of table in the database return: string Singular CamelCase form of $table_name |
foreign_key($class_name) X-Ref |
Get foreign key column corresponding to a table name param: string $table_name Name of table referenced by foreign return: string Column name of the foreign key column |
ordinalize($number) X-Ref |
Add to a number st, nd, rd, th param: integer $number Number to append to return: string Number formatted with correct st, nd, rd, or th |
Généré le : Sun Feb 25 20:04:38 2007 | par Balluche grâce à PHPXref 0.7 |