S
S
serp in2016-01-15 08:01:12
symfony
serp in, 2016-01-15 08:01:12

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

1 answer(s)
A
Andrey Kulikovsky, 2016-01-15
@by25

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 question

Ask a Question

731 491 924 answers to any question