Is there any way to hydrate entities with json data from an incoming request in Symfony2?
I thought there was something similar to
Form::bindRequest
But I can’t find anything…
It would be nice to have this feature for using with libraries like knockout js.
If what you need is to hydrate objects from a JSON (or XML) format, you can take a look at the Serializer component.
It was made to solve this kind of common problem.
You can even try the JMSSerializerBundle that makes the use of this component easier.
About validation, as it’s another component (Validator), you can use it appart of the forms: