[ Index ]
 

Code source de CakePHP 1.1.13.4450

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/cake/libs/ -> inflector.php (sommaire)

Pluralize and singularize English words. Used by Cake's naming conventions throughout the framework.

Copyright: Copyright 2005-2007, Cake Software Foundation, Inc.
License: http://www.opensource.org/licenses/mit-license.php The MIT License
Version: $Revision: 4409 $
Poids: 405 lignes (15 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

Inflector:: (13 méthodes):
  __construct()
  getInstance()
  __initPluralRules()
  pluralize()
  __initSingularRules()
  singularize()
  camelize()
  underscore()
  humanize()
  tableize()
  classify()
  variable()
  __enclose()


Classe: Inflector  - X-Ref

Pluralize and singularize English words.

Inflector pluralizes and singularizes English nouns.
Used by Cake's naming conventions throughout the framework.
Test with $i = new Inflector(); $i->test();

__construct()   X-Ref
Constructor.


getInstance()   X-Ref
Gets a reference to the Inflector object instance

return: object

__initPluralRules()   X-Ref
Initializes plural inflection rules

return: void

pluralize($word)   X-Ref
Return $word in plural form.

param: string $word Word in singular
return: string Word in plural

__initSingularRules()   X-Ref
Initializes singular inflection rules

return: void

singularize($word)   X-Ref
Return $word in singular form.

param: string $word Word in plural
return: string Word in singular

camelize($lowerCaseAndUnderscoredWord)   X-Ref
Returns given $lower_case_and_underscored_word as a camelCased word.

param: string $lower_case_and_underscored_word Word to camelize
return: string Camelized word. likeThis.

underscore($camelCasedWord)   X-Ref
Returns an underscore-syntaxed ($like_this_dear_reader) version of the $camel_cased_word.

param: string $camel_cased_word Camel-cased word to be "underscorized"
return: string Underscore-syntaxed version of the $camel_cased_word

humanize($lowerCaseAndUnderscoredWord)   X-Ref
Returns a human-readable string from $lower_case_and_underscored_word,
by replacing underscores with a space, and by upper-casing the initial characters.

param: string $lower_case_and_underscored_word String to be made more readable
return: string Human-readable string

tableize($className)   X-Ref
Returns corresponding table name for given $class_name. ("posts" for the model class "Post").

param: string $class_name Name of class to get database table name for
return: string Name of the database table for given class

classify($tableName)   X-Ref
Returns Cake model class name ("Post" for the database table "posts".) for given database table.

param: string $tableName Name of database table to get class name for
return: string

variable($string)   X-Ref
Returns camelBacked version of a string.

param: string $string
return: string

__enclose($string)   X-Ref
Enter description here...

param: unknown_type $string
return: unknown



Généré le : Sun Feb 25 19:27:47 2007 par Balluche grâce à PHPXref 0.7