I'm currently creating a form, something along the lines of:
$myDto = // ... etc - I am not using Doctrine
$form = $this->createForm(new DtoType(), $myDto);
$form->bind($request);
The values get bound to the form and end up assigned to $myDto. That's fine.
I would like to prepend a couple of extra fields to my form for a different object.
I could create a "composite" type which contains them both - I could call it CompositeFormType which contains DtoType (the original form) and ActionsType (the new fields), a bit like described here http://symfony.com/doc/current/book/forms.html#embedded-forms.
If that's the best way, then once I have created this CompositeFormType, how would I get the values in/out of the form? What would I pass to 'createForm'? So for example:
$myDto = // ... etc
$actions = // ... etc
$form = $this->createForm(new CompositeFormType(), ???);
// What here? ^
//
// I want both 'actions' and 'myDto' to be populated by
// the child types? How?
$form->bind($request);
... or should I be doing it a completely different way? Thanks in advance for your pointers.