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 423bfae

Browse filesBrowse files
Minor reword
1 parent 740803e commit 423bfae
Copy full SHA for 423bfae

File tree

1 file changed

+5
-7
lines changed
Filter options

1 file changed

+5
-7
lines changed

‎reference/forms/twig_reference.rst

Copy file name to clipboardExpand all lines: reference/forms/twig_reference.rst
+5-7Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -222,20 +222,18 @@ array).
222222
rootform
223223
~~~~~~~~
224224

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

228-
Wrong example if your form has a field named ``parent``:
227+
.. code-block:: twig
229228
230-
.. code-block:: jinja
229+
{# DON'T DO THIS: this code will fail when the form doesn't have a parent
230+
but it defines a normal form field called 'parent' #}
231231
232232
{% if form.parent is null %}
233233
{{ form_errors(form) }}
234234
{% endif %}
235235
236-
Correct example, this will check for the parent form view rather than its ``parent`` field:
237-
238-
.. code-block:: jinja
236+
{# DO THIS: this code will always work, regardless of the form field names #}
239237
240238
{% if form is rootform %}
241239
{{ form_errors(form) }}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.