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.

33 lines
690 B

6 years ago
6 years ago
6 years ago
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Controller;
  4. use Hyperf\HttpServer\Contract\RequestInterface;
  5. use Hyperf\HttpServer\Annotation\AutoController;
  6. /**
  7. * @AutoController()
  8. * Class TestController
  9. * @package App\Controller
  10. */
  11. class TestController extends AbstractController
  12. {
  13. private $name = 'default action';
  14. public function index1(RequestInterface $request)
  15. {
  16. $this->name = 'index1 action';
  17. return $this->name;
  18. }
  19. public function index2(RequestInterface $request)
  20. {
  21. $this->name = 'index2 action';
  22. return $this->name;
  23. }
  24. public function index3(RequestInterface $request)
  25. {
  26. return $this->name;
  27. }
  28. }