Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8ad1724

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

File tree

Expand file treeCollapse file tree

1 file changed

+8
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-4
lines changed

‎cookbook/validation/severity.rst

Copy file name to clipboardExpand all lines: cookbook/validation/severity.rst
+8-4Lines changed: 8 additions & 4 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.