Last active
September 28, 2015 19:01
-
-
Save JuanLuisGarciaBorrego/1da7291ca37a511f23a3 to your computer and use it in GitHub Desktop.
Recibo la petición de un formulario
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @Route("/{id}/formulario-individual", name="formularioIndividual") | |
*/ | |
public function formularioIndividualAction(Equipo $equipo, Request $request) | |
{ | |
$form = $this->createForm(new EquipoType(), $equipo); | |
$form->handleRequest($request); | |
if ($form->isValid()) { | |
$em = $this->getDoctrine()->getManager(); | |
$em->persist($equipo); | |
$em->flush(); | |
return $this->redirectToRoute('homepage'); | |
} | |
return $this->redirectToRoute('formulariosEquipos'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment