Skip to content

Commit eaadf72

Browse files
javiereguiluzGuikingone
authored andcommitted
Minor reword
1 parent 219ca83 commit eaadf72

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

reference/forms/twig_reference.rst

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -204,20 +204,18 @@ array).
204204
rootform
205205
~~~~~~~~
206206

207-
This test will check for sure if the current ``form`` does not have a parent form view.
208-
It would avoid collision and odd behavior when your form has defined a ``parent`` field.
207+
This test will check if the current ``form`` does not have a parent form view.
209208

210-
Wrong example if your form has a field named ``parent``:
209+
.. code-block:: twig
211210
212-
.. code-block:: jinja
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' #}
213213
214214
{% if form.parent is null %}
215215
{{ form_errors(form) }}
216216
{% endif %}
217217
218-
Correct example, this will check for the parent form view rather than its ``parent`` field:
219-
220-
.. code-block:: jinja
218+
{# DO THIS: this code will always work, regardless of the form field names #}
221219
222220
{% if form is rootform %}
223221
{{ form_errors(form) }}

0 commit comments

Comments
 (0)