Class yii\gii\console\GenerateController

Inheritanceyii\gii\console\GenerateController » yii\console\Controller
Available since version2.0

This is the command line version of Gii - a code generator.

You can use this command to generate models, controllers, etc. For example, to generate an ActiveRecord model based on a DB table, you can run:

$ ./yii gii/model --tableName=city --modelClass=City

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$generators array A list of the available code generators yii\gii\console\GenerateController
$module yii\gii\Module yii\gii\console\GenerateController
$overwrite boolean Whether to overwrite all existing code files when in non-interactive mode. yii\gii\console\GenerateController

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
formatHint() yii\gii\console\GenerateController

Property Details

$generators public property

A list of the available code generators

public array $generators = []
$module public property
public yii\gii\Module $module null
$overwrite public property

Whether to overwrite all existing code files when in non-interactive mode. Defaults to false, meaning none of the existing code files will be overwritten. This option is used only when --interactive=0.

public boolean $overwrite false

Method Details

__get() public method

public void __get ( $name )
$name
__set() public method

public void __set ( $name, $value )
$name
$value
actionIndex() public method

public void actionIndex ( )
actions() public method

public void actions ( )
createAction() public method

public void createAction ( $id )
$id
formatHint() protected method

protected void formatHint ( $hint )
$hint
getActionArgsHelp() public method

public void getActionArgsHelp ( $action )
$action
getActionHelp() public method

public void getActionHelp ( $action )
$action
getActionHelpSummary() public method

public void getActionHelpSummary ( $action )
$action
getActionOptionsHelp() public method

public void getActionOptionsHelp ( $action )
$action
getUniqueID() public method

public void getUniqueID ( )
init() public method

public void init ( )
options() public method

public void options ( $id )
$id