Symfony 2 - how to pass data to formBuilder?

前端 未结 6 636
独厮守ぢ
独厮守ぢ 2020-11-30 03:50

I\'m using entity choice list in my form. I want to use only specific entities (in example: only groups that user belongs to) So, in controller, I\'m getting these groups, a

6条回答
  •  孤街浪徒
    2020-11-30 04:16

    Bacteries' solution IS NOT a good one. For example, if you declare your type as service, it is impossible to pass an object to constructor.

    A perfect solution is options - just pass data as option to form builder.

提交回复
热议问题