Skip to content

Commit 8ad1724

Browse files
committed
[#4724] Minor language tweaks and cross-link to form theming
1 parent dbdb408 commit 8ad1724

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

cookbook/validation/severity.rst

+8-4
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ based on some rules. For example, you have a registration form for new users
1010
where they enter some personal information and choose their authentication
1111
credentials. They would have to choose a username and a secure password,
1212
but providing bank account information would be optional. Nonetheless, you
13-
want to make sure that these optional data, if entered, are still valid,
14-
but display them differently.
13+
want to make sure that these optional fields, if entered, are still valid,
14+
but display their errors differently.
1515

1616
The process to achieve this behavior consists of two steps:
1717

@@ -135,7 +135,7 @@ Use the ``payload`` option to configure the error level for each constraint:
135135
The ``getConstraint()`` method in the ``ConstraintViolation`` class was
136136
introduced in Symfony 2.6.
137137

138-
When validating the ``User`` object failed, you can retrieve the constraint
138+
When validation of the ``User`` object fails, you can retrieve the constraint
139139
that caused a particular failure using the
140140
:method:`Symfony\\Component\\Validator\\ConstraintViolation::getConstraint`
141141
method. Each constraint exposes the attached payload as a public property::
@@ -147,7 +147,7 @@ method. Each constraint exposes the attached payload as a public property::
147147
$severity = isset($constraint->payload['severity']) ? $constraint->payload['severity'] : null;
148148

149149
For example, you can leverage this to customize the ``form_errors`` block
150-
such that the severity is added as an additional HTML class:
150+
so that the severity is added as an additional HTML class:
151151

152152
.. code-block:: html+jinja
153153

@@ -163,3 +163,7 @@ such that the severity is added as an additional HTML class:
163163
</ul>
164164
{%- endif -%}
165165
{%- endblock form_errors -%}
166+
167+
.. seealso::
168+
169+
For more information on customizing form rendering, see :doc:`/cookbook/form/form_customization`.

0 commit comments

Comments
 (0)