src/Controller/AppController.php line 14
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
#[Route('/')]
class AppController extends AbstractController
{
#[Route('/', name: 'index', methods: ['GET'])]
public function index(): Response
{
if ($this->getUser()) {
return $this->redirectToRoute('dashboard');
}
return $this->redirectToRoute('app_login');
}
#[Route('/dashboard', name: 'dashboard', methods: ['GET'])]
public function dashboard(): Response
{
return $this->render('dashboard/index.html.twig', []);
}
}