gii\generators\module\Generator successMessage()

successMessage() public method Returns the message to be displayed when the newly generated code is saved successfully. Child classes may override this method to customize the message. public string successMessage ( )return string The message to be displayed when the newly generated code is saved successfully.

gii\generators\module\Generator rules()

rules() public method Returns the validation rules for attributes. Validation rules are used by validate() to check if attribute values are valid. Child classes may override this method to declare different validation rules. Each rule is an array with the following structure: [ ['attribute1', 'attribute2'], 'validator type', 'on' => ['scenario1', 'scenario2'], //...other parameters... ] where attribute list: required, specifies the attributes array to be validated, for s

gii\generators\module\Generator requiredTemplates()

requiredTemplates() public method Returns a list of code template files that are required. Derived classes usually should override this method if they require the existence of certain template files. public array requiredTemplates ( )return array List of code template files that are required. They should be file paths relative to $templatePath.

gii\generators\module\Generator hints()

hints() public method Returns the list of hint messages. The array keys are the attribute names, and the array values are the corresponding hint messages. Hint messages will be displayed to end users when they are filling the form for the generator. public array hints ( )return array The list of hint messages

gii\generators\module\Generator getName()

getName() public method public string getName ( )return string Name of the code generator

gii\generators\module\Generator getModulePath()

getModulePath() public method public boolean getModulePath ( )return boolean The directory that contains the module class

gii\generators\module\Generator getDescription()

getDescription() public method public string getDescription ( )return string The detailed description of the generator.

gii\generators\module\Generator getControllerNamespace()

getControllerNamespace() public method public string getControllerNamespace ( )return string The controller namespace of the module.

gii\generators\module\Generator generate()

generate() public method Generates the code based on the current user input and the specified code template files. This is the main method that child classes should implement. Please refer to yii\gii\generators\controller\Generator::generate() as an example on how to implement this method. public yii\gii\CodeFile[] generate ( )return yii\gii\CodeFile[] A list of code files to be created.

gii\generators\module\Generator attributeLabels()

attributeLabels() public method Returns the attribute labels. Attribute labels are mainly used for display purpose. For example, given an attribute firstName, we can declare a label First Name which is more user-friendly and can be displayed to end users. By default an attribute label is generated using generateAttributeLabel(). This method allows you to explicitly specify attribute labels. Note, in order to inherit labels defined in the parent class, a child class needs to merge the parent