HelloController.php 1022 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * @link http://www.yiiframework.com/
  4. * @copyright Copyright (c) 2008 Yii Software LLC
  5. * @license http://www.yiiframework.com/license/
  6. */
  7. namespace app\commands;
  8. use yii\console\Controller;
  9. /**
  10. * This command echoes the first argument that you have entered.
  11. *
  12. * This command is provided as an example for you to learn how to create console commands.
  13. *
  14. * @author Qiang Xue <qiang.xue@gmail.com>
  15. * @since 2.0
  16. */
  17. class HelloController extends Controller
  18. {
  19. /**
  20. * This command echoes what you have entered as the message.
  21. * @param string $message the message to be echoed.
  22. */
  23. public function actionIndex($message = 'hello world')
  24. {
  25. echo $message . "\n";
  26. }
  27. public function actionTest()
  28. {
  29. echo 'Test?';
  30. }
  31. // public function getDescription($actionID = null)
  32. // {
  33. // return "I'm custom description for $actionID!";
  34. // }
  35. public function getHelp($actionID = null)
  36. {
  37. return "I'm custom help for $actionID!";
  38. }
  39. }