Bake Class Reference
Public Member Functions | |
| Bake () | |
| bakeController ($controllerName, $uses, $helpers, $components, $actions= '', $wannaUseScaffold= 'y') | |
| bakeDbConfig ($driver, $connect, $host, $login, $password, $database, $prefix) | |
| bakeModel ($name, $useDbConfig= 'default', $useTable=null, $primaryKey= 'id', $validate=array(), $associations=array()) | |
| bakeUnitTest ($type, $className) | |
| bakeView ($controllerName, $actionName, $content= '') | |
| divTag ($class, $text) | |
| doController () | |
| doDbConfig () | |
| doModel () | |
| doUnitTest () | |
| doView () | |
| generateAreaDiv ($tagName, $prompt, $required=false, $errorMsg=null, $cols=60, $rows=10, $htmlOptions=null) | |
| generateCheckboxDiv ($tagName, $prompt, $required=false, $errorMsg=null, $htmlOptions=null) | |
| generateDate ($tagName, $prompt, $required=false, $errorMsg=null, $size=20, $htmlOptions=null, $selected=null) | |
| generateDateTime ($tagName, $prompt, $required=false, $errorMsg=null, $size=20, $htmlOptions=null, $selected=null) | |
| generateFields ($fields, $readOnly=false) | |
| generateInputDiv ($tagName, $prompt, $required=false, $errorMsg=null, $size=20, $htmlOptions=null) | |
| generateSelectDiv ($tagName, $prompt, $options, $selected=null, $selectAttr=null, $optionAttr=null, $required=false, $errorMsg=null) | |
| generateSubmitDiv ($displayText, $htmlOptions=null) | |
| generateTime ($tagName, $prompt, $required=false, $errorMsg=null, $size=20, $htmlOptions=null, $selected=null) | |
| getInput ($prompt, $options=null, $default=null) | |
| help () | |
| hr () | |
| main () | |
| project ($projectPath=null) | |
| stderr ($string) | |
| stdout ($string, $newline=true) | |
| welcome () | |
Public Attributes | |
| $controllerName = null | |
| $interactive = false | |
| $stderr | |
| $stdin | |
| $stdout | |
Detailed Description
Definition at line 151 of file bake.php.
Member Function Documentation
| Bake::bakeController | ( | $ | controllerName, | |
| $ | uses, | |||
| $ | helpers, | |||
| $ | components, | |||
| $ | actions = '', |
|||
| $ | wannaUseScaffold = 'y' | |||
| ) |
Assembles and writes a Controller file.
- Parameters:
-
string $controllerName array $uses array $helpers array $components string $actions
Definition at line 1677 of file bake.php.
References $filename, $help, and Inflector::camelize().
| Bake::bakeDbConfig | ( | $ | driver, | |
| $ | connect, | |||
| $ | host, | |||
| $ | login, | |||
| $ | password, | |||
| $ | database, | |||
| $ | prefix | |||
| ) |
Creates a database configuration file for Bake.
- Parameters:
-
string $host string $login string $password string $database
Definition at line 1514 of file bake.php.
References $filename.
Referenced by doDbConfig().
| Bake::bakeModel | ( | $ | name, | |
| $ | useDbConfig = 'default', |
|||
| $ | useTable = null, |
|||
| $ | primaryKey = 'id', |
|||
| $ | validate = array(), |
|||
| $ | associations = array() | |||
| ) |
| Bake::bakeUnitTest | ( | $ | type, | |
| $ | className | |||
| ) |
| Bake::bakeView | ( | $ | controllerName, | |
| $ | actionName, | |||
| $ | content = '' | |||
| ) |
| Bake::divTag | ( | $ | class, | |
| $ | text | |||
| ) |
| Bake::doController | ( | ) |
Action to create a Controller.
Definition at line 1128 of file bake.php.
References $help, Inflector::camelize(), and Inflector::underscore().
Referenced by main().
| Bake::doDbConfig | ( | ) |
Database configuration setup.
Definition at line 252 of file bake.php.
References bakeDbConfig(), Configuration, getInput(), hr(), and stdout().
Referenced by main().
| Bake::doModel | ( | ) |
Action to create a Model.
Definition at line 363 of file bake.php.
References bakeModel(), bakeUnitTest(), doUnitTest(), ConnectionManager::getDataSource(), getInput(), hr(), stdout(), and Inflector::tableize().
Referenced by main().
| Bake::doUnitTest | ( | ) |
| Bake::doView | ( | ) |
Action to create a View.
Definition at line 766 of file bake.php.
References $controllerName, $file, $shortPath, bakeView(), Inflector::camelize(), getInput(), hr(), stdout(), and Inflector::underscore().
Referenced by main().
| Bake::generateAreaDiv | ( | $ | tagName, | |
| $ | prompt, | |||
| $ | required = false, |
|||
| $ | errorMsg = null, |
|||
| $ | cols = 60, |
|||
| $ | rows = 10, |
|||
| $ | htmlOptions = null | |||
| ) |
| Bake::generateCheckboxDiv | ( | $ | tagName, | |
| $ | prompt, | |||
| $ | required = false, |
|||
| $ | errorMsg = null, |
|||
| $ | htmlOptions = null | |||
| ) |
| Bake::generateDate | ( | $ | tagName, | |
| $ | prompt, | |||
| $ | required = false, |
|||
| $ | errorMsg = null, |
|||
| $ | size = 20, |
|||
| $ | htmlOptions = null, |
|||
| $ | selected = null | |||
| ) |
| Bake::generateDateTime | ( | $ | tagName, | |
| $ | prompt, | |||
| $ | required = false, |
|||
| $ | errorMsg = null, |
|||
| $ | size = 20, |
|||
| $ | htmlOptions = null, |
|||
| $ | selected = null | |||
| ) |
| Bake::generateFields | ( | $ | fields, | |
| $ | readOnly = false | |||
| ) |
Takes an array of database fields, and generates an HTML form for a View. This is an extraction from the Scaffold functionality.
- Parameters:
-
array $fields boolean $readOnly
- Returns:
- Generated HTML and PHP.
Definition at line 1909 of file bake.php.
References ClassRegistry::getObject(), and Inflector::underscore().
| Bake::generateInputDiv | ( | $ | tagName, | |
| $ | prompt, | |||
| $ | required = false, |
|||
| $ | errorMsg = null, |
|||
| $ | size = 20, |
|||
| $ | htmlOptions = null | |||
| ) |
| Bake::generateSelectDiv | ( | $ | tagName, | |
| $ | prompt, | |||
| $ | options, | |||
| $ | selected = null, |
|||
| $ | selectAttr = null, |
|||
| $ | optionAttr = null, |
|||
| $ | required = false, |
|||
| $ | errorMsg = null | |||
| ) |
| Bake::generateSubmitDiv | ( | $ | displayText, | |
| $ | htmlOptions = null | |||
| ) |
| Bake::generateTime | ( | $ | tagName, | |
| $ | prompt, | |||
| $ | required = false, |
|||
| $ | errorMsg = null, |
|||
| $ | size = 20, |
|||
| $ | htmlOptions = null, |
|||
| $ | selected = null | |||
| ) |
| Bake::getInput | ( | $ | prompt, | |
| $ | options = null, |
|||
| $ | default = null | |||
| ) |
Prompts the user for input, and returns it.
- Parameters:
-
string $prompt Prompt text. mixed $options Array or string of options. string $default Default input value.
- Returns:
- Either the default value, or the user-provided input.
Definition at line 1810 of file bake.php.
Referenced by doDbConfig(), doModel(), doView(), and main().
| Bake::hr | ( | ) |
| Bake::main | ( | ) |
Main-loop method.
Definition at line 207 of file bake.php.
References doController(), doDbConfig(), doModel(), doView(), getInput(), hr(), and stdout().
| Bake::project | ( | $ | projectPath = null |
) |
| Bake::stderr | ( | $ | string | ) |
| Bake::stdout | ( | $ | string, | |
| $ | newline = true | |||
| ) |
| Bake::welcome | ( | ) |
Member Data Documentation
The documentation for this class was generated from the following file:
- 1.1.x.x/cake/scripts/bake.php