Skip to content

Commit 6c3c575

Browse files
javiereguiluzGuikingone
authored andcommitted
Reworded the code comments
1 parent 1b53735 commit 6c3c575

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

reference/forms/twig_reference.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,14 @@ This test will check if the current ``form`` does not have a parent form view.
208208

209209
.. code-block:: twig
210210
211-
{# DON'T DO THIS: this code will fail when the form doesn't have a parent
212-
but it defines a normal form field called 'parent' #}
211+
{# DON'T DO THIS: this simple check can't differentiate between a form having
212+
a parent form view and a form defining a normal form field called 'parent' #}
213213
214214
{% if form.parent is null %}
215215
{{ form_errors(form) }}
216216
{% endif %}
217217
218-
{# DO THIS: this code will always work, regardless of the form field names #}
218+
{# DO THIS: this check is always reliable, even if the form defines a field called 'parent' #}
219219
220220
{% if form is rootform %}
221221
{{ form_errors(form) }}

0 commit comments

Comments
 (0)