<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use App\Repository\UsersRepository;
use App\Entity\Users;
class MainController extends AbstractController
{
#[Route('/', name: 'app_main')]
public function index(): Response
{
return $this->render('main/index.html.twig', [
'controller_name' => 'MainController',
]);
}
#[Route('/home', name: 'app_accueil_membre')]
public function accueil(UsersRepository $userRepo):Response
{
//Lister les membres par ordre descendant de date de création
$users = $userRepo->retourMembres();
return $this->render('main/home.html.twig', [
'membres' => $users
]);
//return $this->render('main/home.html.twig');
}
#[Route('/main/menuPrincipal', name: 'app_menu_principal')]
public function menuPrincipal(): Response
{
return $this->render('main/menuPrincipal.html.twig');
}
}