PHP Class yii\console\controllers\HelpController

This command displays the available command list in the application or the detailed instructions about using a specific command. This command can be used as follows on command line: yii help [command name] In the above, if the command name is not provided, all available commands will be displayed.
Since: 2.0
Author: Qiang Xue ([email protected])
Inheritance: extends yii\console\Controller
Afficher le fichier Open project: yiisoft/yii2 Class Usage Examples

Méthodes publiques

Méthode Description
actionIndex ( string $command = null ) : integer Displays available commands or the detailed information about a particular command.
getActions ( Controller $controller ) : array Returns all available actions of the specified controller.
getCommands ( ) : array Returns all available command names.

Méthodes protégées

Méthode Description
formatOptionAliases ( Controller $controller, string $option ) : string
formatOptionHelp ( string $name, boolean $required, string $type, mixed $defaultValue, string $comment ) : string Generates a well-formed string for an argument or option.
getCommandDescriptions ( ) : array Returns an array of commands an their descriptions.
getCommandHelp ( Controller $controller ) Displays the overall information of the command.
getDefaultHelp ( ) Displays all available commands.
getDefaultHelpHeader ( ) : string Return a default help header.
getModuleCommands ( Module $module ) : array Returns available commands of a specified module.
getScriptName ( ) : string
getSubCommandHelp ( Controller $controller, string $actionID ) Displays the detailed information of a command action.
validateControllerClass ( string $controllerClass ) : boolean Validates if the given class is a valid console controller class.

Method Details

actionIndex() public méthode

Displays available commands or the detailed information about a particular command.
public actionIndex ( string $command = null ) : integer
$command string The name of the command to show help about. If not provided, all available commands will be displayed.
Résultat integer the exit status

formatOptionAliases() protected méthode

Since: 2.0.8
protected formatOptionAliases ( Controller $controller, string $option ) : string
$controller yii\console\Controller the controller instance
$option string the option name
Résultat string the formatted string for the alias argument or option

formatOptionHelp() protected méthode

Generates a well-formed string for an argument or option.
protected formatOptionHelp ( string $name, boolean $required, string $type, mixed $defaultValue, string $comment ) : string
$name string the name of the argument or option
$required boolean whether the argument is required
$type string the type of the option or argument
$defaultValue mixed the default value of the option or argument
$comment string comment about the option or argument
Résultat string the formatted string for the argument or option

getActions() public méthode

Returns all available actions of the specified controller.
public getActions ( Controller $controller ) : array
$controller yii\console\Controller the controller instance
Résultat array all available action IDs.

getCommandDescriptions() protected méthode

Returns an array of commands an their descriptions.
protected getCommandDescriptions ( ) : array
Résultat array all available commands as keys and their description as values.

getCommandHelp() protected méthode

Displays the overall information of the command.
protected getCommandHelp ( Controller $controller )
$controller yii\console\Controller the controller instance

getCommands() public méthode

Returns all available command names.
public getCommands ( ) : array
Résultat array all available command names

getDefaultHelp() protected méthode

Displays all available commands.
protected getDefaultHelp ( )

getDefaultHelpHeader() protected méthode

Return a default help header.
Since: 2.0.11
protected getDefaultHelpHeader ( ) : string
Résultat string default help header.

getModuleCommands() protected méthode

Returns available commands of a specified module.
protected getModuleCommands ( Module $module ) : array
$module yii\base\Module the module instance
Résultat array the available command names

getScriptName() protected méthode

protected getScriptName ( ) : string
Résultat string the name of the cli script currently running.

getSubCommandHelp() protected méthode

Displays the detailed information of a command action.
protected getSubCommandHelp ( Controller $controller, string $actionID )
$controller yii\console\Controller the controller instance
$actionID string action ID

validateControllerClass() protected méthode

Validates if the given class is a valid console controller class.
protected validateControllerClass ( string $controllerClass ) : boolean
$controllerClass string
Résultat boolean