Symfony2 is able to creates dynamic generation .
However, there is a big problem with the dynamic generation of inline forms based on user submitted data:
If I use FormEvents :: PRE_SET_DATA, then I can not get post data for the inline form - only the data of the parent objects is available
$builder->get('contacts')->addEventListener( FormEvents::POST_SET_DATA function(FormEvent $event) { $data = $event->getData();
If I use FormEvents :: POST_SUBMIT, then I can receive the data, but I can not change the form
$builder->get('contacts')->addEventListener( FormEvents::POST_SUBMIT, function(FormEvent $event) { $data = $event->getData();
Please help: is there a way to dynamically generate an inline form based on user submitted data?
I am using Symfony 2.4.
Thank you in advance!
source share