From 4cf7ec14a90fc697e90ed9ecfeb1a5da5bec3c5f Mon Sep 17 00:00:00 2001 From: Olivier PARPAILLON Date: Tue, 19 Nov 2024 16:55:21 +0100 Subject: [PATCH] add view profile, and create edit profile route --- src/Controller/ProfileController.php | 36 ++++++++++++++++++++++++++++ templates/main/header.html.twig | 8 +++---- templates/profile/index.html.twig | 20 ++++++++++++++++ templates/profile/view.html.twig | 36 ++++++++++++++++++++++++++++ 4 files changed, 96 insertions(+), 4 deletions(-) create mode 100644 src/Controller/ProfileController.php create mode 100644 templates/profile/index.html.twig create mode 100644 templates/profile/view.html.twig diff --git a/src/Controller/ProfileController.php b/src/Controller/ProfileController.php new file mode 100644 index 0000000..5a2e7de --- /dev/null +++ b/src/Controller/ProfileController.php @@ -0,0 +1,36 @@ +findOneBy(['idParticipant' => $uuid]); + return $this->render('profile/view.html.twig', [ + 'profile' => $currentProfile, + ]); + } + + #[Route('/profile/edit/{uuid}', name: 'profile_edit', methods: ['GET', 'POST'])] + public function editProfile(string $uuid, ParticipantRepository $participantRepository, Request $request): Response + { + $currentProfile = $participantRepository->findOneBy(['idParticipant' => $uuid]); + $form = $this->createForm(RegistrationFormType::class, $currentProfile); + $form->handleRequest($request); + if ($form->isSubmitted() && $form->isValid()) { + + } + return $this->render('profile/view.html.twig', [ + 'profile' => $currentProfile, + ]); + } +} diff --git a/templates/main/header.html.twig b/templates/main/header.html.twig index f76085d..c005059 100644 --- a/templates/main/header.html.twig +++ b/templates/main/header.html.twig @@ -23,10 +23,10 @@ burger-menu