src/Controller/BaseController.php line 38

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Repository\AperitifsRepository;
  4. use App\Repository\BieresRepository;
  5. use App\Repository\BoissonChaudesRepository;
  6. use App\Repository\BurgerRepository;
  7. use App\Repository\CafeRepository;
  8. use App\Repository\ChampagneRepository;
  9. use App\Repository\CocktailRepository;
  10. use App\Repository\DessertsRepository;
  11. use App\Repository\DigestifsRepository;
  12. use App\Repository\EauxRepository;
  13. use App\Repository\EntreeRepository;
  14. use App\Repository\GlaceRepository;
  15. use App\Repository\GratinsRepository;
  16. use App\Repository\JusDeFruitRepository;
  17. use App\Repository\KirsRepository;
  18. use App\Repository\PatesRepository;
  19. use App\Repository\PizzasRepository;
  20. use App\Repository\PlancheAperoRepository;
  21. use App\Repository\PoissonsRepository;
  22. use App\Repository\SaladesRepository;
  23. use App\Repository\SiropsRepository;
  24. use App\Repository\SodaRepository;
  25. use App\Repository\TheRepository;
  26. use App\Repository\ViandesRepository;
  27. use App\Repository\VinsAuVerreRepository;
  28. use App\Repository\VinsPBRepository;
  29. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  30. use Symfony\Component\Routing\Annotation\Route;
  31. class BaseController extends AbstractController
  32. {
  33.     #[Route('/'name'index')]
  34.     public function index()
  35.     {
  36.         return $this->render('pages/index.html.twig');
  37.     }
  38.     #[Route('/aperitif'name'aperitif')]
  39.     public function aperitif(AperitifsRepository $aperitifsRepositoryKirsRepository $kirsRepositoryBieresRepository $bieresRepositoryChampagneRepository $champagneRepositoryDigestifsRepository $digestifsRepository)
  40.     {
  41.         $aperitifs $aperitifsRepository->findAll('DESC');
  42.         $kirs $kirsRepository->findAll('DESC');
  43.         $bieres $bieresRepository->findAll('DESC');
  44.         $champagnes $champagneRepository->findAll('DESC');
  45.         $digestifs $digestifsRepository->findAll('DESC');
  46.         return $this->render('pages/aperitif.html.twig', [
  47.             'aperitifs' => $aperitifs,
  48.             'kirs' => $kirs,
  49.             'bieres' => $bieres,
  50.             'champagnes' => $champagnes,
  51.             'digestifs' => $digestifs,
  52.             'current_menu' => 'aperitif'
  53.         ]);
  54.     }
  55.     #[Route('/cocktail'name'cocktail')]
  56.     public function cocktail(CocktailRepository $cocktailRepository)
  57.     {
  58.         $cocktails $cocktailRepository->findAll('DESC');
  59.         return $this->render('pages/cocktail.html.twig', [
  60.             'cocktails' => $cocktails,
  61.             'current_menu' => 'cocktail'
  62.         ]);
  63.     }
  64.     #[Route('/boisson'name'boisson')]
  65.     public function boisson(SodaRepository $sodaRepositoryEauxRepository $eauxRepositoryJusDeFruitRepository $jusDeFruitRepositorySiropsRepository $siropsRepository)
  66.     {
  67.         $sodas $sodaRepository->findAll('DESC');
  68.         $eaux $eauxRepository->findAll('DESC');
  69.         $jus $jusDeFruitRepository->findAll('DESC');
  70.         $sirops $siropsRepository->findAll('DESC');
  71.         return $this->render('pages/boisson.html.twig', [
  72.             'sodas' => $sodas,
  73.             'eaux' => $eaux,
  74.             'jus' => $jus,
  75.             'sirops' => $sirops,
  76.             'current_menu' => 'boisson'
  77.         ]);
  78.     }
  79.     #[Route('/boissons-chaudes'name'boissonChaude')]
  80.     public function boissonChaude(CafeRepository $cafeRepositoryTheRepository $theRepositoryBoissonChaudesRepository $boissonChaudesRepository)
  81.     {
  82.         $cafes $cafeRepository->findAll('DESC');
  83.         $thes $theRepository->findAll('DESC');
  84.         $boissonsChaudes $boissonChaudesRepository->findAll('DESC');
  85.         return $this->render('pages/boissonChaudes.html.twig', [
  86.             'cafes' => $cafes,
  87.             'thes' => $thes,
  88.             'boissonsChaudes' => $boissonsChaudes,
  89.             'current_menu' => 'boissonChaude'
  90.         ]);
  91.     }
  92.     #[Route('/desserts'name'dessert')]
  93.     public function dessert(DessertsRepository $dessertsRepositoryGlaceRepository $glaceRepository)
  94.     {
  95.         $desserts $dessertsRepository->findAll('DESC');
  96.         $glaces $glaceRepository->findAll('DESC');
  97.         return $this->render('pages/dessert.html.twig', [
  98.             'desserts' => $desserts,
  99.             'glaces' => $glaces,
  100.             'current_menu' => 'dessert'
  101.         ]);
  102.     }
  103.     #[Route('/nos-vins'name'vin')]
  104.     public function vin(VinsPBRepository $vinsPBRepositoryVinsAuVerreRepository $vinsAuVerreRepository)
  105.     {
  106.         $vinsPB $vinsPBRepository->findAll('DESC');
  107.         $vinsV $vinsAuVerreRepository->findAll('DESC');
  108.         return $this->render('pages/vin.html.twig', [
  109.             'vinsPB' => $vinsPB,
  110.             'vinsV' => $vinsV,
  111.             'current_menu' => 'vin'
  112.         ]);
  113.     }
  114.     #[Route('/entrees-et-salades'name'entree')]
  115.     public function entree(EntreeRepository $entreeRepositorySaladesRepository $saladesRepository)
  116.     {
  117.         $entrees $entreeRepository->findAllActive();
  118.         $salades $saladesRepository->findAllActive();
  119.         return $this->render('pages/entree.html.twig', [
  120.             'entrees' => $entrees,
  121.             'salades' => $salades,
  122.             'current_menu' => 'entree'
  123.         ]);
  124.     }
  125.     #[Route('/plats'name'plat')]
  126.     public function plat(ViandesRepository $viandesRepositoryPoissonsRepository $poissonsRepository)
  127.     {
  128.         $viandes $viandesRepository->findAllActive();
  129.         $poissons $poissonsRepository->findAllActive();
  130.         return $this->render('pages/plat.html.twig', [
  131.             'viandes' => $viandes,
  132.             'poissons' => $poissons,
  133.             'current_menu' => 'plat'
  134.         ]);
  135.     }
  136.     #[Route('/pates-et-gratin'name'pates')]
  137.     public function pates(PatesRepository $patesRepositoryGratinsRepository $gratinsRepository)
  138.     {
  139.         $pates $patesRepository->findAllActive();
  140.         $gratins $gratinsRepository->findAllActive();
  141.         return $this->render('pages/pates.html.twig', [
  142.             'pates' => $pates,
  143.             'gratins' => $gratins,
  144.             'current_menu' => 'pates'
  145.         ]);
  146.     }
  147.     #[Route('/burgers'name'burger')]
  148.     public function burger(BurgerRepository $burgerRepository)
  149.     {
  150.         $burgers $burgerRepository->findAllActive();
  151.         return $this->render('pages/burger.html.twig', [
  152.             'burgers' => $burgers,
  153.             'current_menu' => 'burger'
  154.         ]);
  155.     }
  156.     #[Route('/pizzas'name'pizza')]
  157.     public function pizza(PizzasRepository $pizzasRepository)
  158.     {
  159.         $pizzas $pizzasRepository->findAllActive();
  160.         return $this->render('pages/pizza.html.twig', [
  161.             'pizzas' => $pizzas,
  162.             'current_menu' => 'pizza'
  163.         ]);
  164.     }
  165.     #[Route('/formules'name'formule')]
  166.     public function formules()
  167.     {
  168.         return $this->render('pages/formule.html.twig', [
  169.             'current_menu' => 'formule'
  170.         ]);
  171.     }
  172.     #[Route('/assiette-apero'name'planche')]
  173.     public function planche(PlancheAperoRepository $plancheAperoRepository)
  174.     {
  175.         $planches $plancheAperoRepository->findAllActive();
  176.         return $this->render('pages/planche.html.twig', [
  177.             'planches' => $planches,
  178.             'current_menu' => 'planche'
  179.         ]);
  180.     }
  181. }