src/Controller/PartialsController.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Repository\CategorieRepository;
  4. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  5. use Symfony\Component\HttpFoundation\Response;
  6. use Symfony\Component\Routing\Annotation\Route;
  7. #[Route('/auth')]
  8. class PartialsController extends AbstractController
  9. {
  10.     private $categories;
  11.     private $categorieRepository;
  12.     public function __construct(CategorieRepository $categorieRepository){
  13.         $this->categorieRepository $categorieRepository;
  14.         $this->categories $categorieRepository->findAll();
  15.     }
  16.     public function renderFooter(string $template): Response
  17.     {
  18.         $data = [
  19.             'categories' => $this->categories
  20.         ];
  21.         $content $this->renderView($template$data);
  22.         return new Response($content);
  23.     }
  24. }