View EquipoController.php
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("/formularios-equipos", name="formulariosEquipos") | |
*/ | |
public function formulariosEquiposAction() | |
{ | |
$equipos = $this->getDoctrine()->getManager()->getRepository('AppBundle:Equipo')->findAll(); | |
$forms = []; //creo una variable tipo array. | |
foreach($equipos as $equipo) { |
View crear2.html.twig
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
{% for form in formsRender %} | |
{{ form_start(form, {'action': path('formularioIndividual', {id: form.vars.value.id} )}) }} | |
{{ form_errors(form) }} | |
{{ form_widget(form) }} | |
<input type="submit" value="Enviar"> | |
{{ form_end(form) }} | |
<hr> | |
{% endfor %} |
View formularioIndividualAction.php
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()) { |
View crear.html.twig
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
{% for form in formsRender %} | |
{{ form_start(form) }} | |
{{ form_errors(form) }} | |
{{ form_widget(form) }} | |
<input type="submit" value="Enviar"> | |
{{ form_end(form) }} | |
<hr> | |
{% endfor %} |
View FormulariosEquiposPrimero.php
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("/formularios-equipos", name="formulariosEquipos") | |
*/ | |
public function formulariosEquiposAction() | |
{ | |
$equipos = $this->getDoctrine()->getManager()->getRepository('AppBundle:Equipo')->findAll(); //Devuelve un array de objetos | |
$forms = []; //creo una variable tipo array. | |
foreach($equipos as $equipo) { |
View crearEquiposFormRequest.php
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(Request $request)//Recibimos la respuesta tipo objeto Request | |
{ | |
$equipo = new Equipo(); | |
$form = $this->createForm(new EquipoType(), $equipo); | |
$form->handleRequest($request); //pasamos la respuesta al habdleRequest |
View crearEquipoFormPrimero.php
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( |
View crear-equipo-form-1.php
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( |
View ArticleRepository
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
class ArticleRepository implements CRUDInterface | |
{ | |
public function insert($data) | |
{ | |
//acción insert en BD | |
} | |
public function update($data) | |
{ | |
//acción update en BD | |
} |
View CRUDInterface.php
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
interface CRUDInterface extends CRUInterface, DeleteInterface | |
{ | |
} |
NewerOlder