Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5f8aa34

Browse files
committed
feature #30357 [TwigBridge] rename parent_form() to form_parent() (xabbuh)
This PR was merged into the 4.3-dev branch. Discussion ---------- [TwigBridge] rename parent_form() to form_parent() | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | symfony/symfony-docs#11049 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. Commits ------- 057d177 rename parent_form() to form_parent()
2 parents b4f6c34 + 057d177 commit 5f8aa34

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Symfony/Bridge/Twig/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ CHANGELOG
44
4.3.0
55
-----
66

7-
* added the `parent_form()` function that allows to reliably retrieve the parent form in Twig templates
7+
* added the `form_parent()` function that allows to reliably retrieve the parent form in Twig templates
88

99
4.2.0
1010
-----

src/Symfony/Bridge/Twig/Extension/FormExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function getFunctions()
5454
new TwigFunction('form_start', null, ['node_class' => 'Symfony\Bridge\Twig\Node\RenderBlockNode', 'is_safe' => ['html']]),
5555
new TwigFunction('form_end', null, ['node_class' => 'Symfony\Bridge\Twig\Node\RenderBlockNode', 'is_safe' => ['html']]),
5656
new TwigFunction('csrf_token', ['Symfony\Component\Form\FormRenderer', 'renderCsrfToken']),
57-
new TwigFunction('parent_form', 'Symfony\Bridge\Twig\Extension\twig_get_parent_form'),
57+
new TwigFunction('form_parent', 'Symfony\Bridge\Twig\Extension\twig_get_form_parent'),
5858
];
5959
}
6060

@@ -120,7 +120,7 @@ function twig_is_root_form(FormView $formView)
120120
/**
121121
* @internal
122122
*/
123-
function twig_get_parent_form(FormView $formView): ?FormView
123+
function twig_get_form_parent(FormView $formView): ?FormView
124124
{
125125
return $formView->parent;
126126
}

0 commit comments

Comments
 (0)