App_Controller_IndexController.proxy.php 823 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. declare (strict_types=1);
  3. /**
  4. * This file is part of Hyperf.
  5. *
  6. * @link https://www.hyperf.io
  7. * @document https://hyperf.wiki
  8. * @contact group@hyperf.io
  9. * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
  10. */
  11. namespace App\Controller;
  12. class IndexController extends AbstractController
  13. {
  14. use \Hyperf\Di\Aop\ProxyTrait;
  15. use \Hyperf\Di\Aop\PropertyHandlerTrait;
  16. function __construct()
  17. {
  18. if (method_exists(parent::class, '__construct')) {
  19. parent::__construct(...func_get_args());
  20. }
  21. $this->__handlePropertyHandler(__CLASS__);
  22. }
  23. public function index()
  24. {
  25. $user = $this->request->input('user', 'Hyperf');
  26. $method = $this->request->getMethod();
  27. return ['method' => $method, 'message' => "Hello {$user}."];
  28. }
  29. }