Answer the question
In order to leave comments, you need to log in
Symfony2 Forms mapping one form field to multiple entity fields?
A banal example, there is one form field full_name, but in essence first_name, last_name and mid_name.
Actually how to do it right? Through your form's DataMapper? How will the error handling be done, i.e. if first_name is in error, how will it get into the form?
So far, I figured out how to add entity fields to the form, followed by processing in the PRE_SUBMIT event. But it's not pretty.
Answer the question
In order to leave comments, you need to log in
You can use DataTransformer. Read more here: symfony.com/doc/current/cookbook/form/data_transfo...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question