Skip to content

Commit 07cd155

Browse files
committed
minor symfony#10999 document the parent_form() Twig function (xabbuh)
This PR was merged into the master branch. Discussion ---------- document the parent_form() Twig function documents symfony/symfony#28812 Commits ------- 2ea9797 document the parent_form() Twig function
2 parents c822d38 + 2ea9797 commit 07cd155

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

form/form_customization.rst

Lines changed: 12 additions & 0 deletions
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)