src/Action/ProjectAction.php line 15

Open in your IDE?
  1. <?php
  2. declare(strict_types 1);
  3. namespace App\Action;
  4. use App\Domain\Repository\Interfaces\TextRepositoryInterface;
  5. use App\Infra\Services\ApiService;
  6. use App\Infra\Services\FilterApiService;
  7. use App\Responder\RedirectResponder;
  8. use App\Responder\TemplateResponder;
  9. use Symfony\Component\Routing\Annotation\Route;
  10. use Symfony\Contracts\HttpClient\HttpClientInterface;
  11. class ProjectAction extends AbstractAction
  12. {
  13.     public function __construct(
  14.         TemplateResponder $templateResponder,
  15.         RedirectResponder $redirectResponder,
  16.         FilterApiService $filterApiService
  17.     )
  18.     {
  19.         $this->templateResponder $templateResponder;
  20.         $this->redirectResponder $redirectResponder;
  21.         $this->filterApiService $filterApiService;
  22.     }
  23.     /**
  24.      * @Route("/projets", name="projects")
  25.      */
  26.     public function __invoke()
  27.     {
  28.         $projects $this->filterApiService->getAllProjects();
  29.         return $this->templateResponder->__invoke('project.html.twig', [
  30.             'projects' => $projects
  31.         ]);
  32.     }
  33. }