<?php
namespace App\Controller;
use App\Repository\EvenementRepository;
use App\Repository\RealisationRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class HomeController extends AbstractController
{
private $realisationRepository;
private $evenementRepository;
public function __construct(RealisationRepository $realisationRepository, EvenementRepository $evenementRepository)
{
$this->realisationRepository = $realisationRepository;
$this->evenementRepository = $evenementRepository;
}
/**
* @Route("/", name="home")
*/
public function index(): Response
{
$lastsReal = $this->realisationRepository->findLasts(4);
$lastEvent = $this->evenementRepository->findLasts(5);
return $this->render('home/index.html.twig', [
'lastsReal' => $lastsReal,
'lastsEvent' => $lastEvent,
]);
}
}