Conditions | 3 |
Paths | 2 |
Total Lines | 16 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | #[Route('/user/profile', name: 'user_profile')] |
||
17 | public function profile(Request $request, EntityManagerInterface $entityManager): Response |
||
18 | { |
||
19 | $profile = $this->getUser()->getProfile(); |
||
|
|||
20 | $form = $this->createForm(ProfileType::class, $profile); |
||
21 | $form->handleRequest($request); |
||
22 | |||
23 | if ($form->isSubmitted() && $form->isValid()) { |
||
24 | $entityManager->persist($profile); |
||
25 | $entityManager->flush(); |
||
26 | $this->addFlash('success', 'message.updated'); |
||
27 | } |
||
28 | |||
29 | return $this->render('user/profile/profile.html.twig', [ |
||
30 | 'site' => $this->site($request), |
||
31 | 'form' => $form->createView(), |
||
32 | ]); |
||
35 |