28 lines
847 B
PHP
28 lines
847 B
PHP
<?php
|
|
|
|
namespace App\Controller;
|
|
|
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
|
use Symfony\Component\HttpFoundation\Response;
|
|
use Symfony\Component\Routing\Attribute\Route;
|
|
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
|
|
|
class MainController extends AbstractController
|
|
{
|
|
#[Route('/', name: 'home')]
|
|
public function index(TokenStorageInterface $tokenStorage): Response
|
|
{
|
|
$token = $tokenStorage->getToken();
|
|
$userConnect = $token?->getUser();
|
|
return $this->render('main/index.html.twig', [
|
|
'profile' => $userConnect,
|
|
]);
|
|
}
|
|
|
|
#[Route('/inscription', name: 'inscription')]
|
|
public function inscription(TokenStorageInterface $tokenStorage): Response
|
|
{
|
|
return $this->render('main/inscription.html.twig');
|
|
}
|
|
}
|