Skip to content

Commit 2ea9797

Browse files
committed
document the parent_form() Twig function
1 parent c03e4c0 commit 2ea9797

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

form/form_customization.rst

+12
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,18 @@ obvious (since it'll render the field for you).
312312
313313
{{ form_rest(form) }}
314314
315+
parent_form(form_view)
316+
......................
317+
318+
.. versionadded:: 4.3
319+
320+
The ``parent_form()`` function was introduced in Symfony 4.3.
321+
322+
Returns the parent form view or ``null`` if the form view already is the
323+
root form. Using this function should be preferred over accessing the parent
324+
form using ``form.parent``. The latter way will produce different results
325+
when a child form is named ``parent``.
326+
315327
Tests
316328
~~~~~
317329

0 commit comments

Comments
 (0)