Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function mainAction(Request $request)
- {
- $user = $this->getUser();
- $form = $this->createForm(UserType::class, $user);
- $form->handleRequest($request);
- if ($form->isValid() && $form->isSubmitted()) {
- $password = $this->get('security.password_encoder')
- ->encodePassword($user, $user->getPlainPassword());
- $user->setPassword($password);
- $em = $this->getDoctrine()->getEntityManager();
- $em->persist($user);
- $em->flush();
- }
- return $this->render('AppBundle:uzduotis:index.html.twig', [
- 'form' => $form->createView(),
- 'user' => $user
- ]);
- }
- * @Route("/logout", name="logout")
- * @Method({"GET"})
- */
- public function logoutAction(Request $request)
- {
- $session = $this->$request->getSession();
- $session = $this->get('session')->clear();
- return $this->render('AppBundle:uzduotis:login.html.twig');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement