Property | Type | Description | |
---|---|---|---|
$answers | user confirmations on whether to overwrite existing code files with the newly generated ones. The value of this property is internally managed by this class and {@link CCodeGenerator}. | ||
$files | a list of {@link CCodeFile} objects that represent the code files to be generated. The {@link prepare()} method is responsible to populate this property. | ||
$status | the status of this model. T The value of this property is internally managed by {@link CCodeGenerator}. | ||
$template | the name of the code template that the user has selected. The value of this property is internally managed by this class and {@link CCodeGenerator}. |
Method | Description | |
---|---|---|
attributeLabels ( ) : array | Declares the model attribute labels. | |
class2id ( string $name ) : string | Converts a class name into a HTML ID. | |
class2name ( string $name, boolean $ucwords = true ) : string | Converts a class name into space-separated words. | |
class2var ( string $name ) : string | Converts a class name into a variable name with the first letter in lower case. | |
classExists ( string $name ) : boolean | Checks if the named class exists (in a case sensitive manner). | |
confirmed ( CCodeFile $file ) | ||
errorMessage ( ) : string | Returns the message to be displayed when some error occurred during code file saving. | |
getStickyFile ( ) : string | ||
getTemplatePath ( ) : string | ||
getTemplates ( ) : array | Returns a list of available code templates (name=>directory). | |
loadStickyAttributes ( ) | Loads sticky attributes from a file and populates them into the model. | |
pluralize ( string $name ) : string | Converts a word to its plural form. | |
prepare ( ) | Prepares the code files to be generated. | |
render ( string $templateFile, array $_params_ = null ) : string | Generates the code using the specified code template file. | |
renderResults ( ) : string | ||
requiredTemplates ( ) : array | Returns a list of code templates that are required. | |
rules ( ) : array | Declares the model validation rules. | |
save ( ) | Saves the generated code into files. | |
saveStickyAttributes ( ) | Saves sticky attributes into a file. | |
sticky ( string $attribute, array $params ) | The "sticky" validator. | |
successMessage ( ) : string | Returns the message to be displayed when the newly generated code is saved successfully. | |
validateReservedWord ( string $attribute, array $params ) | Validates an attribute to make sure it is not taking a PHP reserved keyword. | |
validateTemplate ( string $attribute, array $params ) | Validates the template selection. |
return array_merge(parent::attributeLabels(), array( ...labels for the child class attributes... ));.
public attributeLabels ( ) : array | ||
return | array | the attribute labels |
public classExists ( string $name ) : boolean | ||
$name | string | class name to be checked |
return | boolean | whether the class exists |
public confirmed ( CCodeFile $file ) | ||
$file | CCodeFile | whether the code file should be saved |
public errorMessage ( ) : string | ||
return | string | the message to be displayed when some error occurred during code file saving. |
public getStickyFile ( ) : string | ||
return | string | the file path that stores the sticky attribute values. |
public getTemplatePath ( ) : string | ||
return | string | the directory that contains the template files. |
public getTemplates ( ) : array | ||
return | array | a list of available code templates (name=>directory). |
public loadStickyAttributes ( ) |
abstract public prepare ( ) |
public renderResults ( ) : string | ||
return | string | the code generation result log. |
public requiredTemplates ( ) : array | ||
return | array | list of code templates that are required. They should be file paths relative to {@link templatePath}. |
return array_merge(parent::rules(), array( ...rules for the child class... ));.
public saveStickyAttributes ( ) |
public successMessage ( ) : string | ||
return | string | the message to be displayed when the newly generated code is saved successfully. |
public validateReservedWord ( string $attribute, array $params ) | ||
$attribute | string | the attribute to be validated |
$params | array | validation parameters |
public validateTemplate ( string $attribute, array $params ) | ||
$attribute | string | the attribute to be validated |
$params | array | validation parameters |
public $answers |
public $files |
public $status |