Inflector Class Reference

Inheritance diagram for Inflector:

Object

List of all members.


Public Member Functions

getInstance ()

Static Public Member Functions

 camelize ($lowerCaseAndUnderscoredWord)
 classify ($tableName)
 humanize ($lowerCaseAndUnderscoredWord)
 pluralize ($word)
 singularize ($word)
 slug ($string, $replacement= '_')
 tableize ($className)
 underscore ($camelCasedWord)
 variable ($string)

Detailed Description

Definition at line 47 of file inflector.php.


Member Function Documentation

Inflector::camelize ( lowerCaseAndUnderscoredWord  )  [static]

Inflector::classify ( tableName  )  [static]

Returns Cake model class name ("Post" for the database table "posts".) for given database table.

Parameters:
string $tableName Name of database table to get class name for
Returns:
string public

Definition at line 396 of file inflector.php.

References camelize(), and singularize().

& Inflector::getInstance (  ) 

Gets a reference to the Inflector object instance

Returns:
object public

Definition at line 61 of file inflector.php.

Referenced by pluralize(), and singularize().

Inflector::humanize ( lowerCaseAndUnderscoredWord  )  [static]

Returns a human-readable string from $lower_case_and_underscored_word, by replacing underscores with a space, and by upper-casing the initial characters.

Parameters:
string $lower_case_and_underscored_word String to be made more readable
Returns:
string Human-readable string public

Definition at line 372 of file inflector.php.

Referenced by Controller::generateFieldNames(), and View::renderLayout().

Inflector::pluralize ( word  )  [static]

Return $word in plural form.

Parameters:
string $word Word in singular
Returns:
string Word in plural public

Definition at line 161 of file inflector.php.

References $pluralRules, and getInstance().

Referenced by Model::_clearCache(), Controller::generateFieldNames(), and tableize().

Inflector::singularize ( word  )  [static]

Return $word in singular form.

Parameters:
string $word Word in plural
Returns:
string Word in singular public

Definition at line 302 of file inflector.php.

References $singularRules, and getInstance().

Referenced by classify().

Inflector::slug ( string,
replacement = '_' 
) [static]

Returns a string with all spaces converted to $replacement and non word characters removed.

Parameters:
string $string
string $replacement
Returns:
string public

Definition at line 423 of file inflector.php.

Inflector::tableize ( className  )  [static]

Returns corresponding table name for given $class_name. ("posts" for the model class "Post").

Parameters:
string $class_name Name of class to get database table name for
Returns:
string Name of the database table for given class public

Definition at line 384 of file inflector.php.

References pluralize(), and underscore().

Referenced by Bake::doModel().

Inflector::underscore ( camelCasedWord  )  [static]

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

Parameters:
string $camel_cased_word Camel-cased word to be "underscorized"
Returns:
string Underscore-syntaxed version of the $camel_cased_word public

Definition at line 359 of file inflector.php.

Referenced by View::_getViewFileName(), View::_loadHelpers(), ClassRegistry::addObject(), Bake::bakeView(), Controller::constructClasses(), Dispatcher::dispatch(), Bake::doController(), Bake::doView(), Controller::generateFieldNames(), Bake::generateFields(), ClassRegistry::getObject(), ClassRegistry::isKeySet(), DboSource::query(), ClassRegistry::removeObject(), View::render(), Controller::render(), Set::reverse(), tableize(), HtmlHelper::url(), and variable().

Inflector::variable ( string  )  [static]

Returns camelBacked version of a string.

Parameters:
string $string
Returns:
string public

Definition at line 408 of file inflector.php.

References camelize(), and underscore().

Referenced by View::_loadHelpers().


The documentation for this class was generated from the following file: