src/Controller/Website/TerritoireInterventionController.php line 37

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Website;
  3. use App\Repository\ContactRepository;
  4. use App\Repository\CategoryRepository;
  5. use Sulu\Bundle\SearchBundle\Controller\WebsiteSearchController;
  6. use Symfony\Component\HttpFoundation\Response;
  7. use Twig\Environment;
  8. class TerritoireInterventionController extends WebsiteSearchController
  9. {
  10.     private Environment $twig;
  11.     private ContactRepository $ct;
  12.     private CategoryRepository $ca;
  13.     public function __construct(Environment $twigContactRepository $ctCategoryRepository $ca)
  14.     {
  15.         $this->twig $twig;
  16.         $this->ct $ct;
  17.         $this->ca $ca;
  18.     }
  19.     public function getAllTerritoireAction(): Response
  20.     {   
  21.         $results $this->ca->findAll();
  22.         $response = new Response(
  23.             $this->twig->render(
  24.                 'search/territoire_result.html.twig',
  25.                 ['results' => $results]
  26.             )
  27.         );
  28.         return $response;
  29.     }
  30.     
  31.     public function getAllTerritoireUserAction(): Response
  32.     {   
  33.         $results $this->ct->findAllUniqueterritoires();
  34.         $response = new Response(
  35.             $this->twig->render(
  36.                 'search/territoire_annuaire_result.html.twig',
  37.                 ['results' => $results]
  38.             )
  39.         );
  40.         return $response;
  41.     }
  42. }