From c81d30ad4618deae0bd3312881cd8036e86dd22a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Bu=C3=9Fmann?= Date: Sun, 7 Jul 2019 12:59:49 +0200 Subject: [PATCH] Added example for direct form submit with validation See https://github.com/symfony/symfony/issues/25331. --- form/direct_submit.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/form/direct_submit.rst b/form/direct_submit.rst index e5475a988de..c586195ac79 100644 --- a/form/direct_submit.rst +++ b/form/direct_submit.rst @@ -89,3 +89,8 @@ method, pass the submitted data directly to "PATCH" method, the validation extension will only handle the submitted fields. If the underlying data needs to be validated, this should be done manually, i.e. using the validator. + + When you need validation for some fields you can extend your data array with the required ones so that they will be validated. + i.e.:: + + $form->submit(array_merge(['email' => null, 'username' => null], $request->request->all()), false);