src/Controller/LibrairieController.php line 45

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Entity\Menu;
  4. use App\Repository\MenuRepository;
  5. use App\Repository\PublicationRepository;
  6. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  7. use Symfony\Component\HttpFoundation\Response;
  8. use Symfony\Component\Routing\Annotation\Route;
  9. class LibrairieController extends AbstractController
  10. {
  11.     #[Route('/librairie'name'app_librairie')]
  12.     public function index(): Response
  13.     {
  14.         return $this->render('librairie/index.html.twig', [
  15.             'controller_name' => 'LibrairieController',
  16.         ]);
  17.     }
  18.     public function afficherSidebar()
  19.     {
  20.         return $this->render('default/sidebar.html.twig');
  21.     }
  22.     public function afficherSlide(PublicationRepository $publicationRepository)
  23.     {
  24.         $publications $publicationRepository->findBy(['estSlide' => true]);
  25.         return $this->render('default/slide.html.twig'compact('publications'));
  26.     }
  27.     public function afficherAproposAccueil(PublicationRepository $publicationRepository)
  28.     {
  29.         $publications $publicationRepository->findBy(['menu' => 6]);
  30.         return $this->render('default/sessionapropos.html.twig'compact('publications'));
  31.     }
  32.     public function afficherServicesAccueil(PublicationRepository $publicationRepository)
  33.     {
  34.         $publications $publicationRepository->findBy(['menu' => 3],[],3);
  35.         return $this->render('default/sessionservice.html.twig'compact('publications'));
  36.     }
  37.     public function afficherStatistiqueAccueil(PublicationRepository $publicationRepository)
  38.     {
  39.         $publications $publicationRepository->findBy(['menu' => 8]);
  40.         return $this->render('default/sessionstatistique.html.twig'compact('publications'));
  41.     }
  42.     public function afficherSession(PublicationRepository $publicationRepository$id null)
  43.     {
  44.         $publications $publicationRepository->findBy(['menu' => ($id)? $id ]);
  45.         return $this->render('default/slide.html.twig'compact('publications'));
  46.     }
  47.     public function afficherAriane(PublicationRepository $publicationRepositoryMenu $menu)
  48.     {
  49.         // $publications = $publicationRepository->findBy(['menu' => ($id)? $id : 0 ]);
  50.         $publications '';
  51.         return $this->render('default/ariane.html.twig'compact('publications','menu'));
  52.     }
  53.     public function afficherFooter(PublicationRepository $publicationRepository)
  54.     {
  55.         // $publications = $publicationRepository->findBy(['menu' => ($id)? $id : 0 ]);
  56.         $publications '';
  57.         return $this->render('default/footer.html.twig'compact('publications'));
  58.     }
  59.     public function afficherMenu(MenuRepository $menuRepository$menuactive null)
  60.     {
  61.         $menus $menuRepository->findBy(['menuparent' => NULL'estMasque' => false ]);
  62.         return $this->render('default/afficherMenu.html.twig', array(
  63.             'menus' => $menus,
  64.             'menuactive' => ($menuactive) ? $menuactive->getId() : null,
  65.         ));
  66.     }
  67.     // {
  68.     //     $menus = $menuRepository->findBy(['menuparent' => NULL, 'estMasque' => false ]);
  69.     //     return $this->render('default/afficherMenu.html.twig', array(
  70.     //         'menus' => $menus,
  71.     //     ));
  72.     // }
  73. }