Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form action="{{ path('rechercheEtudiant') }}">
- @Email :
- <input type="text" name="email" required="required">
- <button type="submit" class="btn btn-primary">Recherche</button>
- </form>
- //////////////////////
- /**
- * @route("/rechercheEtudiant" , name="rechercheEtudiant")
- */
- public function recherche (Request $request )
- {
- $params = $request->query->all();
- $email = $request->get('email');
- $em = $this->getDoctrine()->getManager();
- $repo = $em->getRepository(Etudiant::class);
- $Etudiant = $repo->findBy(array('email' => $email));
- if (!$Etudiant) {
- throw $this->createNotFoundException("No User" . $email);
- // return $this->redirectToRoute("affiche");
- }
- return $this->render("etudiant/recherche.html.twig", [
- "etudiant" => $Etudiant
- ]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement