rename parent_form() to form_parent()

We got some feedback on the blog post that form_parent() would be better
for consistency with all the existing form_*() functions. I think that
user has a point about that.
This commit is contained in:
Christian Flothmann 2019-02-23 10:52:13 +01:00
parent fec0475e8c
commit 057d177378
2 changed files with 3 additions and 3 deletions

View File

@ -4,7 +4,7 @@ CHANGELOG
4.3.0
-----
* added the `parent_form()` function that allows to reliably retrieve the parent form in Twig templates
* added the `form_parent()` function that allows to reliably retrieve the parent form in Twig templates
4.2.0
-----

View File

@ -54,7 +54,7 @@ class FormExtension extends AbstractExtension
new TwigFunction('form_start', null, ['node_class' => 'Symfony\Bridge\Twig\Node\RenderBlockNode', 'is_safe' => ['html']]),
new TwigFunction('form_end', null, ['node_class' => 'Symfony\Bridge\Twig\Node\RenderBlockNode', 'is_safe' => ['html']]),
new TwigFunction('csrf_token', ['Symfony\Component\Form\FormRenderer', 'renderCsrfToken']),
new TwigFunction('parent_form', 'Symfony\Bridge\Twig\Extension\twig_get_parent_form'),
new TwigFunction('form_parent', 'Symfony\Bridge\Twig\Extension\twig_get_form_parent'),
];
}
@ -120,7 +120,7 @@ function twig_is_root_form(FormView $formView)
/**
* @internal
*/
function twig_get_parent_form(FormView $formView): ?FormView
function twig_get_form_parent(FormView $formView): ?FormView
{
return $formView->parent;
}