<?php
namespace App\Controller;
use App\Repository\EntradasRepository;
use App\Repository\SopasRepository;
use App\Repository\PeixeRepository;
use App\Repository\CarneRepository;
use App\Repository\SobremesasRepository;
use App\Repository\BebidasRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class MainController extends AbstractController
{
#[Route('/', name: 'app_index')]
public function index(): Response
{
return $this->render('main/index.html.twig', []);
}
#[Route('/main', name: 'app_main')]
public function main(EntradasRepository $entradas, SopasRepository $sopas, PeixeRepository $peixe, CarneRepository $carne, SobremesasRepository $sobremesas, BebidasRepository $bebidas): Response
{
return $this->render('main/main.html.twig', [
'entradas' => $entradas->findBy([], ['createdAt' => 'DESC']),
'sopas' => $sopas->findBy([], ['createdAt' => 'DESC']),
'peixes' => $peixe->findBy([], ['createdAt' => 'DESC']),
'carnes' => $carne->findBy([], ['createdAt' => 'DESC']),
'sobremesas' => $sobremesas->findBy([], ['createdAt' => 'DESC']),
'bebidas' => $bebidas->findBy([], ['createdAt' => 'DESC']),
]);
}
#[Route('/invisuais', name: 'app_invisuais')]
public function invisuais(EntradasRepository $entradas, SopasRepository $sopas, PeixeRepository $peixe, CarneRepository $carne, SobremesasRepository $sobremesas, BebidasRepository $bebidas): Response
{
return $this->render('main/invisuais.html.twig', [
'entradas' => $entradas->findBy([], ['createdAt' => 'DESC']),
'sopas' => $sopas->findBy([], ['createdAt' => 'DESC']),
'peixes' => $peixe->findBy([], ['createdAt' => 'DESC']),
'carne' => $carne->findBy([], ['createdAt' => 'DESC']),
'sobremesas' => $sobremesas->findBy([], ['createdAt' => 'DESC']),
'bebidas' => $bebidas->findBy([], ['createdAt' => 'DESC']),
]);
}
}