You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
802 B

8 months ago
  1. <?php
  2. /**
  3. * @link https://www.yiiframework.com/
  4. * @copyright Copyright (c) 2008 Yii Software LLC
  5. * @license https://www.yiiframework.com/license/
  6. */
  7. namespace app\commands;
  8. use yii\console\Controller;
  9. use yii\console\ExitCode;
  10. /**
  11. * This command echoes the first argument that you have entered.
  12. *
  13. * This command is provided as an example for you to learn how to create console commands.
  14. *
  15. * @author Qiang Xue <qiang.xue@gmail.com>
  16. * @since 2.0
  17. */
  18. class HelloController extends Controller
  19. {
  20. /**
  21. * This command echoes what you have entered as the message.
  22. * @param string $message the message to be echoed.
  23. * @return int Exit code
  24. */
  25. public function actionIndex($message = 'hello world')
  26. {
  27. echo $message . "\n";
  28. return ExitCode::OK;
  29. }
  30. }