Merge branch 'Johan'
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Repository\SiteRepository;
|
||||
use App\Repository\SortieRepository;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
@@ -11,12 +12,14 @@ use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInt
|
||||
class MainController extends AbstractController
|
||||
{
|
||||
#[Route('/', name: 'home')]
|
||||
public function index(TokenStorageInterface $tokenStorage, SortieRepository $sortieRepository): Response
|
||||
public function index(TokenStorageInterface $tokenStorage, SortieRepository $sortieRepository, SiteRepository $siteRepository): Response
|
||||
{
|
||||
$token = $tokenStorage->getToken();
|
||||
$userConnect = $token?->getUser();
|
||||
$sorties = $sortieRepository->findAll();
|
||||
$sites = $siteRepository->findAll();
|
||||
return $this->render('main/index.html.twig', [
|
||||
'sites' => $sites,
|
||||
'profile' => $userConnect,
|
||||
'sorties' => $sorties,
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user