Answer the question
In order to leave comments, you need to log in
How to pass data from Request to Entity without using FormType?
Hello.
Please tell me if there is a possibility not to use Symfony forms, but to be able to be just as elegant:
$form = $this->createForm(new BriefType(), new Brief());
$form->handleRequest($request);
if($form->isValid()){
$brief = $form->getData();
// ....
}
Answer the question
In order to leave comments, you need to log in
to be as elegant, you need to do the same. There are no other forms in symfony2 (officially, maybe there are some implementations on the github).
But, for the API, you can use JMS_Serializer.
In any case, you have the $request object - write your own implementations of creating an entity from the data, and your bicycles will be "just as elegant" for you
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question