Answer the question
In order to leave comments, you need to log in
How to create a complex form in Symfony?
Form is tied to essence. Is it possible to make the form completely change itself when changing only one select?
Simple example:
There is a select with 3 items:
Answer the question
In order to leave comments, you need to log in
remove required from dependent fields, and push the check, depending on the type of property
, either into the listener, or into the validator, or into the manager (service),
or at worst into the controller by adding the FormError form.
On the client, the same logic, respectively.
If you want to get confused and write some abstractions around this form, please contact ...
But for such a trivial task it would be more reasonable to write a mini-crutch in the form of a direct enumeration of the fields.
(Of course it depends on the situation)
As a result, I use The Great Suspender extension - I'm satisfied!
chrome.google.com/webstore/detail/kjecajkoiikaohhagojedcphegkcfobm/details?hl=en-US
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question