I have a complex database schema in my Symfony2 application, with a lot of entities linked to each others.
Consequently, my forms are also complicated : I can have many linked forms ; for example a "Cinema" can have an Address, but can also be linked to several "Movies" (with a button to add a new movie).
It's very very difficult to handle this using basic Symfony2 form Types ; I prefer to create my own form manually in a Twig view ; using a bunch of Javascript.
But I don't know how to handle the form submission ?
- Should I define a CinemaType and use it only to handle the form request (but not for creating the form view) ?
- Should I use a
createFormBuilder()
in my Controller to define the basic form fields and check them with thehandleRequest()
method ? - Or, finally, should get all my _POST data and check them manually ?
Thanks :)