I have the following controller:
public function postStuffAction(Request $request)
{
$form = $this->createFormBuilder()
->add("name", "text")
->getForm();
$form->handleRequest($request);
return $form->isValid(); //False
//return $form->getErrorsAsString(); //No errors
}
This is my form:
<form enctype="multipart/form-data" method="post" action="http://mydomain/resource/1?XDEBUG_SESSION_START=appointmed">
<input type="text" name="name" />
<button class="btn btn-success" type="submit"> Upload file </button>
</form>
This form lives in a different domain, it is not redenred as a twig template, is just a plain html form.
When the controller gets the request the form is always empty, what could be happenning?
this form lives in a different domain? I see the action to another domain but I don't see why you build the form on the controller and try to validate it usinghandleRequestsince that form it's not a Symfony2 form is just "another form" try to get the request as for example$request->get('name')and see if it has values and values are valid or something other way to go