Skip to content

clarify constraints on non-submitted forms #12365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 25, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion form/without_class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ But if the form is not mapped to an object and you instead want to retrieve a
simple array of your submitted data, how can you add constraints to the data of
your form?

The answer is to setup the constraints yourself, and attach them to the individual
The answer is to set up the constraints yourself, and attach them to the individual
fields. The overall approach is covered a bit more in :doc:`this validation article </validation/raw_values>`,
but here's a short example::

Expand Down Expand Up @@ -112,3 +112,9 @@ but here's a short example::
If the form is not mapped to an object, every object in your array of
submitted data is validated using the ``Symfony\Component\Validator\Constraints\Valid``
constraint, unless you :doc:`disable validation </form/disabling_validation>`.

.. caution::

When a form is only partially submitted (for example, in an HTTP PATCH
request), only the constraints from the submitted form fields will be
evaluated.