src/Controller/Website/DepartementController.php line 22

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Website;
  3. use App\Repository\ContactRepository;
  4. use Sulu\Bundle\SearchBundle\Controller\WebsiteSearchController;
  5. use Symfony\Component\HttpFoundation\Response;
  6. use Twig\Environment;
  7. class DepartementController extends WebsiteSearchController
  8. {
  9.     private Environment $twig;
  10.     private ContactRepository $ct;
  11.     public function __construct(Environment $twigContactRepository $ct)
  12.     {
  13.         $this->twig $twig;
  14.         $this->ct $ct;
  15.     }
  16.     public function getAllDepartementAction(): Response
  17.     {   
  18.         $departments $this->ct->findAllUniqueDepartments();
  19.         $response = new Response(
  20.             $this->twig->render(
  21.                 'search/departement_userlist_result.html.twig',
  22.                 ['results' => $departments]
  23.             )
  24.         );
  25.     
  26.         return $response;
  27.     }
  28. }