Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Use cross references for internal links
  • Loading branch information
javiereguiluz committed Sep 19, 2018
commit 8e41b9806b2296c5385a131d9185af91ceb42544
10 changes: 4 additions & 6 deletions best_practices/forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,10 @@ view layer:
Validation
----------

The `constraints`_ option allows you to attach `validation constraints`_ to any
form field. However, doing that prevents the validation from being reused in
other forms or other places where the mapped object is used.
The :ref:`constraints <reference-form-option-constraints>` option allows you to
attach :doc:`validation constraints </reference/constraints>` to any form field.
However, doing that prevents the validation from being reused in other forms or
other places where the mapped object is used.

.. best-practice::

Expand Down Expand Up @@ -235,6 +236,3 @@ like the form is *always* processed (even on the GET request).
----

Next: :doc:`/best_practices/i18n`

.. _`constraints`: https://symfony.com/doc/current/reference/forms/types/form.html#constraints
.. _`validation constraints`: https://symfony.com/doc/current/reference/constraints.html
2 changes: 2 additions & 0 deletions reference/forms/types/form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ option on the form.

.. include:: /reference/forms/types/options/compound.rst.inc

.. _reference-form-option-constraints:

.. include:: /reference/forms/types/options/constraints.rst.inc

.. include:: /reference/forms/types/options/data.rst.inc
Expand Down