Closed
Description
Description
At the moment when you want to submit a form in a controller most of the time you should call 3 methods handleRequest($request)
, isSubmitted()
and isValid()
see documentation and if you call isValid()
without calling isSubmitted()
before it will throw an Exception
I know it's little magic but the simple idea is to aggregate the 3 methods in 1.
the method will handle the request, check if the form isSubmitted and if it's valid.
Example
public function add(Request $request)
{
//create $form
//do some stuff
if($form->isCorrect($request)) {
// Do some stuff with $form
}
The method name is a simple example. I'am ready to work on if you're OK
I think the community have already spoken about that, but I'm not sure, WDYT ?
Metadata
Metadata
Assignees
Labels
DX = Developer eXperience (anything that improves the experience of using Symfony)DX = Developer eXperience (anything that improves the experience of using Symfony)