refactor + homepage

This commit is contained in:
Constantin Simonis 2025-01-11 18:43:57 +01:00
parent e39c170402
commit 51c5e9ac57
Signed by: csimonis
GPG Key ID: 3878FF77C24AF4D2
3 changed files with 26 additions and 2 deletions

View File

@ -0,0 +1,17 @@
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
class HomeController extends AbstractController
{
#[Route(path: '/', name: 'app_home', methods: Request::METHOD_GET)]
public function __invoke(): Response
{
return $this->render('home/index.html.twig');
}
}

View File

@ -10,7 +10,7 @@ use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
class SecurityController extends AbstractController class SecurityController extends AbstractController
{ {
#[Route(path: '/login', name: 'app_login')] #[Route(path: '/login', name: 'app_login', methods: [Request::METHOD_GET, Request::METHOD_POST])]
public function login(AuthenticationUtils $authenticationUtils): Response public function login(AuthenticationUtils $authenticationUtils): Response
{ {
return $this->render('security/login.html.twig', [ return $this->render('security/login.html.twig', [
@ -19,7 +19,7 @@ class SecurityController extends AbstractController
]); ]);
} }
#[Route(path: '/logout', name: 'app_logout')] #[Route(path: '/logout', name: 'app_logout', methods: Request::METHOD_GET)]
public function logout(): void public function logout(): void
{ {
throw new \LogicException('This method can be blank - it will be intercepted by the logout key on your firewall.'); throw new \LogicException('This method can be blank - it will be intercepted by the logout key on your firewall.');

View File

@ -0,0 +1,7 @@
{% extends 'base.html.twig' %}
{% block title %}Home!{% endblock %}
{% block body %}
Home
{% endblock %}