Tutorial 2 : Login Application using Symfony2 symfony symfony, 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'); } } NextArticle plus récent PreviousArticle plus ancien Hssan Riahi Hssan Riahi is a Web Developer, designer and a programmer.He loves experimenting with technology and codes. symfony
Post A Comment:
0 comments: