jeudi 26 mars 2015

Symfony2.6: displays a different form following the type of data chosen by user

in my Symfony project, I have these entities with their relations:


enter image description here


I display all equipements datas in a table. In this table I add an edit button which allow user to edit all datas from the chosen equipement.


But as you can see, an equipements could have one type, and following this type, the equipements is not the same. I would like to display the right form type if I choose a specific equipement. And I know that the equipements entities is not the owner of these relation.


For example, I'am in the index of equipements (table displaying all datas from equipements). I choose to edit an equipement wich have the type 1, so I need to display the formType of Equipement_1 (Equipement_1Type). But If I choose an equipement of type 2, I need to display the formType of Equipement_2 (Equipement_2Type).


i don't really know if it's a good way, but I need to know how it works. Someone could help? It's possible to make this?


Aucun commentaire:

Enregistrer un commentaire