From 2ea9797b2b6500bdcf94e927f4b4818beeeac0f6 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sat, 16 Feb 2019 11:40:53 +0100 Subject: [PATCH] document the parent_form() Twig function --- form/form_customization.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/form/form_customization.rst b/form/form_customization.rst index 0aaa095ae6c..3334dfe1689 100644 --- a/form/form_customization.rst +++ b/form/form_customization.rst @@ -312,6 +312,18 @@ obvious (since it'll render the field for you). {{ form_rest(form) }} +parent_form(form_view) +...................... + +.. versionadded:: 4.3 + + The ``parent_form()`` function was introduced in Symfony 4.3. + +Returns the parent form view or ``null`` if the form view already is the +root form. Using this function should be preferred over accessing the parent +form using ``form.parent``. The latter way will produce different results +when a child form is named ``parent``. + Tests ~~~~~