Inflector Class Reference

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 49 of file inflector.php.
Member Function Documentation
| Inflector::camelize | ( | $ | lowerCaseAndUnderscoredWord | ) | [static] |
Returns given $lower_case_and_underscored_word as a CamelCased word.
- Parameters:
-
string $lower_case_and_underscored_word Word to camelize
- Returns:
- string Camelized word. LikeThis. public
Definition at line 355 of file inflector.php.
Referenced by Shell::_controllerName(), Dispatcher::_invoke(), Shell::_modelName(), Shell::_modelNameFromKey(), AuthComponent::action(), AjaxHelper::autoComplete(), ControllerTask::bake(), TestTask::bake(), classify(), FormHelper::create(), Dispatcher::dispatch(), ShellDispatcher::dispatch(), Helper::domId(), ViewTask::execute(), PluginTask::execute(), ModelTask::execute(), ControllerTask::execute(), ControllerTask::getName(), App::import(), ConsoleShell::initialize(), loadPluginModels(), Shell::loadTasks(), ApiShell::main(), ErrorHandler::missingComponentClass(), ErrorHandler::missingComponentFile(), ErrorHandler::missingHelperClass(), ErrorHandler::missingHelperFile(), paths(), FormHelper::radio(), Controller::render(), Set::reverse(), AjaxHelper::sortable(), and variable().
| 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 404 of file inflector.php.
References camelize(), and singularize().
Referenced by TestTask::bake(), PluginTask::execute(), BakeShell::loadTasks(), and CakeSchema::read().
| & Inflector::getInstance | ( | ) |
Gets a reference to the Inflector object instance
- Returns:
- object public
Definition at line 63 of file inflector.php.
Referenced by Configure::listObjects(), 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 380 of file inflector.php.
Referenced by Shell::_pluralHumanName(), Shell::_singularHumanName(), ControllerTask::bakeActions(), PagesController::display(), FormHelper::error(), FormHelper::inputs(), FormHelper::label(), FormHelper::radio(), View::renderLayout(), and PaginatorHelper::sort().
| Inflector::pluralize | ( | $ | word | ) | [static] |
Return $word in plural form.
- Parameters:
-
string $word Word in singular
- Returns:
- string Word in plural public
Definition at line 166 of file inflector.php.
References $pluralRules, and getInstance().
Referenced by Model::_clearCache(), Shell::_controllerName(), Shell::_pluralHumanName(), Shell::_pluralName(), FormHelper::create(), PluginTask::execute(), FormHelper::input(), BakeShell::loadTasks(), AclNode::node(), 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 310 of file inflector.php.
References $singularRules, and getInstance().
Referenced by Shell::_modelKey(), Shell::_modelName(), Shell::_singularHumanName(), Shell::_singularName(), and 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 431 of file inflector.php.
References String::insert().
Referenced by CacheHelper::cache(), Dispatcher::cached(), View::element(), XcacheEngine::init(), MemcacheEngine::init(), ApcEngine::init(), DataSource::listSources(), and XmlNode::normalize().
| 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 392 of file inflector.php.
References pluralize(), and underscore().
Referenced by ModelTask::bake(), ModelTask::doAssociations(), and ModelTask::fixture().
| 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 367 of file inflector.php.
Referenced by CakeSchema::_build(), Shell::_controllerPath(), ScaffoldView::_getViewFileName(), View::_getViewFileName(), Component::_loadComponents(), View::_loadHelpers(), Shell::_modelKey(), Shell::_pluralHumanName(), Shell::_singularHumanName(), ClassRegistry::addObject(), ViewTask::bake(), PluginTask::bake(), ModelTask::bake(), TestTask::bake(), ModelTask::bakeTest(), ControllerTask::bakeTest(), FormHelper::create(), SchemaShell::dump(), ViewTask::execute(), PluginTask::execute(), TestTask::execute(), ModelTask::fixture(), ClassRegistry::getObject(), App::import(), TestSuiteShell::initialize(), FormHelper::inputs(), ClassRegistry::isKeySet(), FormHelper::label(), loadPluginModels(), Shell::loadTasks(), BakeShell::loadTasks(), TestSuiteShell::main(), ApiShell::main(), ClassRegistry::map(), Router::mapResources(), AclNode::node(), XmlNode::normalize(), DboSource::query(), FormHelper::radio(), ClassRegistry::removeObject(), Controller::render(), tableize(), Model::updateCounterCache(), variable(), and vendor().
| Inflector::variable | ( | $ | string | ) | [static] |
Returns camelBacked version of a string.
- Parameters:
-
string $string
- Returns:
- string public
Definition at line 416 of file inflector.php.
References camelize(), and underscore().
Referenced by Shell::_pluralName(), View::_render(), Shell::_singularName(), ControllerTask::bakeActions(), ShellDispatcher::dispatch(), FormHelper::input(), and Controller::set().
The documentation for this class was generated from the following file:
- 1.2.x.x/cake/libs/inflector.php