I want to create a form in a symfony2 project that redirects to the same page after being processed. However I'm currently receiving always NULL when reading the request $parameters whenever the form is being submitted.
The controller:
public function formAction(Request $request)
{
$parameters = $request->request->all();
var_dump($parameters);
return array();
}
The twig template:
...
<form action="" method="post">
<input type="text" id="username" placeholder="Enter username">
<button type="submit" class="btn btn-default">Submit</button>
</form>
...
nameattribute to yourinputfield.