Class app\commands\HelloController

Inheritanceapp\commands\HelloController » yii\console\Controller
Available since extension's version2.0
Source Code https://github.com/yiisoft/yii2-app-basic/blob/master/commands/HelloController.php

This command echoes the first argument that you have entered.

This command is provided as an example for you to learn how to create console commands.

Public Methods

Hide inherited methods

Method Description Defined By
actionIndex() This command echoes what you have entered as the message. app\commands\HelloController

Method Details

Hide inherited methods

actionIndex() public method

This command echoes what you have entered as the message.

public integer actionIndex ( $message 'hello world' )
$message string

The message to be echoed.

return integer

Exit code

                public function actionIndex($message = 'hello world')
{
    echo $message . "\n";
    return ExitCode::OK;
}