I use Symfony 3
with the fosuserbundle
, and want to create a form, that will add multiple groups to one user.
The layout is not the problem, but to building the form and submitting...
Here is the sourcecode with the important parts:
https://pastebin.com/tyFP8XGK
The current problem is that if I have a user (in my case it is an admin) have any group, I can't add one or more groups and submit without error, BUT if I edit the admin, the groups aren't preselected in the choise, AND if I submit (with no group, one group or more groups) I will be get the error:
Expected argument of type "FOS\UserBundle\Model\GroupInterface", "integer" given
I don't know what I can do to fix it...