@@ 83-91 (lines=9) @@ | ||
80 | ]) |
|
81 | ->add('save', SubmitType::class, array('label' => 'Save')); |
|
82 | ||
83 | if ($request->getMethod() == 'POST') { |
|
84 | $form->handleRequest($request); |
|
85 | if ($form->isValid()) { |
|
86 | $em->persist($user); |
|
87 | $em->flush(); |
|
88 | ||
89 | return $this->redirectToRoute('usersAdmin'); |
|
90 | } |
|
91 | } |
|
92 | ||
93 | return [ |
|
94 | 'title' => $title, |
|
@@ 139-147 (lines=9) @@ | ||
136 | ) |
|
137 | ->getForm(); |
|
138 | ||
139 | if ($request->getMethod() == 'POST') { |
|
140 | $form->handleRequest($request); |
|
141 | if ($form->isValid()) { |
|
142 | $em->remove($user); |
|
143 | $em->flush(); |
|
144 | ||
145 | return $this->redirectToRoute('usersAdmin'); |
|
146 | } |
|
147 | } |
|
148 | ||
149 | $renderedForm = $form->createView(); |
|
150 | } |