ControllerTask Class Reference

Public Member Functions | |
| bake ($controllerName, $actions= '', $helpers=null, $components=null, $uses=null) | |
| bakeActions ($controllerName, $admin=null, $wannaUseSession=true) | |
| bakeTest ($className) | |
| execute () | |
| getName () | |
| help () | |
| initialize () | |
| listAll ($useDbConfig= 'default') | |
Public Attributes | |
| $path = CONTROLLERS | |
| $plugin = null | |
| $tasks = array('Project') | |
Detailed Description
Definition at line 35 of file controller.php.
Member Function Documentation
| ControllerTask::bake | ( | $ | controllerName, | |
| $ | actions = '', |
|||
| $ | helpers = null, |
|||
| $ | components = null, |
|||
| $ | uses = null | |||
| ) |
Assembles and writes a Controller file
- Parameters:
-
string $controllerName Controller name string $actions Actions to add, or set the whole controller to use $scaffold (set $actions to 'scaffold') array $helpers Helpers to use in controller array $components Components to use in controller array $uses Models to use in controller
- Returns:
- string Baked controller private
Definition at line 405 of file controller.php.
References $filename, $out, Shell::$uses, Shell::_controllerPath(), Shell::_modelName(), Inflector::camelize(), Shell::createFile(), and low().
Referenced by execute().
| ControllerTask::bakeActions | ( | $ | controllerName, | |
| $ | admin = null, |
|||
| $ | wannaUseSession = true | |||
| ) |
Bake scaffold actions
- Parameters:
-
string $controllerName Controller name string $admin Admin route to use boolean $wannaUseSession Set to true to use sessions, false otherwise
- Returns:
- string Baked actions private
Definition at line 247 of file controller.php.
References Shell::_controllerPath(), Shell::_modelName(), Shell::_pluralName(), Shell::_singularName(), a(), Shell::err(), Inflector::humanize(), App::import(), and Inflector::variable().
Referenced by execute().
| ControllerTask::bakeTest | ( | $ | className | ) |
Assembles and writes a unit test file
- Parameters:
-
string $className Controller class name
- Returns:
- string Baked test private
Definition at line 460 of file controller.php.
References Shell::$className, $filename, $out, $path, Shell::createFile(), Shell::out(), and Inflector::underscore().
Referenced by execute().
| ControllerTask::execute | ( | ) |
Execution method always used for tasks
public
Definition at line 69 of file controller.php.
References Shell::_checkUnitTest(), bake(), bakeActions(), bakeTest(), Inflector::camelize(), Shell::getAdmin(), Shell::out(), and Configure::read().
| ControllerTask::getName | ( | ) |
Forces the user to specify the controller he wants to bake, and returns the selected controller name.
- Returns:
- string Controller name public
Definition at line 532 of file controller.php.
References Object::_stop(), Inflector::camelize(), Shell::in(), listAll(), and Shell::out().
| ControllerTask::help | ( | ) |
Displays help contents
public
Reimplemented from Shell.
Definition at line 565 of file controller.php.
References Object::_stop(), Shell::hr(), and Shell::out().
| ControllerTask::initialize | ( | ) |
| ControllerTask::listAll | ( | $ | useDbConfig = 'default' |
) |
Outputs and gets the list of possible models or controllers from database
- Parameters:
-
string $useDbConfig Database configuration name
- Returns:
- array Set of controllers public
Definition at line 496 of file controller.php.
References Shell::_controllerName(), Shell::_modelName(), Object::_stop(), config(), Shell::err(), ConnectionManager::getDataSource(), and Shell::out().
Referenced by getName().
Member Data Documentation
| ControllerTask::$path = CONTROLLERS |
| ControllerTask::$plugin = null |
Definition at line 42 of file controller.php.
| ControllerTask::$tasks = array('Project') |
The documentation for this class was generated from the following file:
- 1.2.x.x/cake/console/libs/tasks/controller.php