Answer the question
In order to leave comments, you need to log in
Is it good practice to use forms solely for binding and validation purposes?
Hello.
Actually the question is, is it good practice to use the form component solely for data binding to the model and for validation? For me, these seem convenient when compared with the use of "manual" data binding in the controller, for example, when there are continuous checks for the presence of a key in the array of values , or the same checks, but in the service. if(isset($data['key'])){do_some_code();}
Answer the question
In order to leave comments, you need to log in
If you use something like Backbone on the client, for example, then https://github.com/schmittjoh/JMSSerializerBundle is a good fit, since you don't have to do anything "by hand", everything just runs in json format. For validation there is symfony.com/doc/current/book/validation.html
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question