I have a general question how the currently correct way of processing a submitted form should look like, the symfony docs aren't that clear what's the proper way to go.
Currently I am always doing something like this:
if ($request->isMethod(Request::METHOD_POST)) {
$form->handle($request)
if ($form->isValid()) {...}
}
but I have also seen some examples (also in the symfony docs) where this statement is used:
$form->handle($request);
if ($form->isSubmitted() && $form->isValid()) {...}
So does anyone know what's the currently correct way to go following symfony developer guidelines, should the first statement be used or second, or should both be combined (although this would make either the $request->isMethod call or the $form->isSubmitted redundant)