Class app\commands\HelloController
| Inheritance | app\commands\HelloController » yii\console\Controller |
|---|---|
| Available since extension's version | 2.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
| Method | Description | Defined By |
|---|---|---|
| actionIndex() | This command echoes what you have entered as the message. | app\commands\HelloController |
Method Details
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;
}