FEAUTURE [routing][absence] use routing annotation instead of config file

This commit is contained in:
Julie Lenaerts 2023-01-12 11:10:41 +01:00
parent fb51e44e45
commit b2924ede70
2 changed files with 8 additions and 6 deletions

View File

@ -13,16 +13,22 @@ namespace Chill\MainBundle\Controller;
use Chill\MainBundle\Form\AbsenceType;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
class AbsenceController extends AbstractController
{
/**
* @Route(
* "/{_locale}/absence",
* name="chill_absence_user",
* methods={"GET", "POST"}
* )
*/
public function setAbsence(Request $request)
{
$user = $this->getUser();
$form = $this->createForm(AbsenceType::class, $user);
$form->add('submit', SubmitType::class, ['label' => 'Create']);
$form->handleRequest($request);

View File

@ -94,7 +94,3 @@ login_check:
logout:
path: /logout
chill_absence_user:
path: /{_locale}/absence
controller: Chill\MainBundle\Controller\AbsenceController::setAbsence