Created
September 28, 2015 17:24
-
-
Save JuanLuisGarciaBorrego/09f825155af5dd6b0cc1 to your computer and use it in GitHub Desktop.
Creación del formulario en el controlador antes de recibir la petición
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("/crear-equipo", name="crearEquipo") | |
*/ | |
public function crearEquipoAction() | |
{ | |
$equipo = new Equipo(); //1-Instancio la entidad | |
$form = $this->createForm(new EquipoType(), $equipo); //Utilizo el formulario tipo y le paso el objeto Equipo. | |
return $this->render('default/crear.html.twig', array( | |
'form' => $form->createView() | |
)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment