lundi 30 janvier 2017

Symfony form many-to-many with many-to-many

I have an entity that has a manyToMany relation with category. Category has also a manyToMany relation with sub-category.

In a formType, in the buildForm method, I'm trying to do something like that with checkbox :

My entity form

[ ] category_1  
  [ ] sub-category_1_1  
  [X] sub-category_1_2  
  [ ] sub-category_1_3  
[X] category_2  
  [X] sub-category_2_1  
  [ ] sub-category_2_2  
  [ ] sub-category_2_3  

Has someone already tried this ? Better, someone has a solution ? :D




Aucun commentaire:

Enregistrer un commentaire