<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use App\Repository\TauxAdherentRepository;
use App\Service\CalculMoyenne;
use App\Repository\AdherentRepository;
use App\Repository\MarcheRepository;
class AppController extends AbstractController
{
#[Route('/', name: 'app_app')]
public function index(): Response
{
if ($this->isGranted('ROLE_ADMIN')) {
return $this->redirectToRoute('app_admin', [], Response::HTTP_SEE_OTHER);
}
if ($this->isGranted('ROLE_ANIMATEUR')) {
return $this->redirectToRoute('app_animateur_dashboard', [], Response::HTTP_SEE_OTHER);
}
if ($this->isGranted('ROLE_USER')) {
return $this->redirectToRoute('app_administrateur', [], Response::HTTP_SEE_OTHER);
}
return $this->redirectToRoute('app_login', [], Response::HTTP_SEE_OTHER);
}
}