@@ -17,7 +17,7 @@ control over when exactly your form is submitted and what data is passed to it::
17
17
$form = $this->createForm(TaskType::class, $task);
18
18
19
19
if ($request->isMethod('POST')) {
20
- $form->submit($request->request->all ($form->getName()));
20
+ $form->submit($request->getPayload()->get ($form->getName()));
21
21
22
22
if ($form->isSubmitted() && $form->isValid()) {
23
23
// perform some action...
@@ -41,7 +41,7 @@ the fields defined by the form class. Otherwise, you'll see a form validation er
41
41
if ($request->isMethod('POST')) {
42
42
// '$json' represents payload data sent by React/Angular/Vue
43
43
// the merge of parameters is needed to submit all form fields
44
- $form->submit(array_merge($json, $request->request ->all()));
44
+ $form->submit(array_merge($json, $request->getPayload() ->all()));
45
45
46
46
// ...
47
47
}
@@ -73,4 +73,4 @@ the fields defined by the form class. Otherwise, you'll see a form validation er
73
73
manually so that they are validated::
74
74
75
75
// 'email' and 'username' are added manually to force their validation
76
- $form->submit(array_merge(['email' => null, 'username' => null], $request->request ->all()), false);
76
+ $form->submit(array_merge(['email' => null, 'username' => null], $request->getPayload() ->all()), false);
0 commit comments