Answer the question
In order to leave comments, you need to log in
[ Symfony 2 ] Consolidated Forms and Default Data
Good evening.
I have multiple forms (UserType, ClientType) and I want to make an edit page. To do this, I create a new form in the controller, combining them on the fly:
$form = $this->createFormBuilder()->add('user', new Form\UserType())
->add('client', new Form\ClientType())
->getForm();
Answer the question
In order to leave comments, you need to log in
It so happened that I myself solved my problem, and even wrote a small topic on this topic.
The first comment, to your own article. I did it in a similar way, but with a muscle, and my idea is a little wider.
I described the idea here
Later I made a task even more similar to yours. Combined several forms into one.
Wrote the general object, specified type for it. further wielded with this object.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question