sensio/SensioFrameworkExtraBundle — pull request #138 by beberlei (2012-07-21 01:21:22+00:00)
Title: [WIP] [ParamConverteers] DoctrineFormParamConverter

Converts a request into an object by binding the data through a form type.

UseCase: APIs

/**
* @ParamConverter("user", options={"form_type": "user"})
* @Method("POST")
*/
public function updateUser(User $user)
{
}

Several limitations:

* Not sure if throwing a HttpException 400 with the errors is enough for API clients to work with.
* Does not work with HTML requests, as HTTP 400 cannot be "converted" into a response object of the format:

array("data" => $form->getData(), "form" => $form->createView())

This would be the minimum necessary data to allow FrameworkExtraBundle to do its templating magic, but the param converters dont allow this.