Durman Blog
Monday, June 6, 2016
Tutorial 2 Login Application using Symfony2
Hi
In this tutorial about
Login Application using Symfony2
The controller
render(DWMUserBundle:Default:index.html.twig, array(name => $name)); } public function SigninAction(Request $request) { $em=$this->getDoctrine()->getManager(); $repository =$em->getRepository(DWMUserBundle:User); if($request->getMethod()==POST) { $email=$request->get(email); $password=$request->get(password); $user=$repository->findOneBy(array(email=>$email,password=>$password)); if ($user) //if user has values return $this->render(DWMUserBundle:Default:home.html.twig, array(user => $user)); else//if login is incorrect return $this->render(DWMUserBundle:Default:signin.html.twig); } return $this->render(DWMUserBundle:Default:signin.html.twig); } }
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment