10000 [TwigBridge] rename parent_form() to form_parent() by xabbuh · Pull Request #30357 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[TwigBridge] rename parent_form() to form_parent() #30357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
  • Loading branch information
xabbuh committed Feb 23, 2019
commit 057d1773784fca7bb4883ba60a75570d7ae35ede
2 changes: 1 addition & 1 deletion src/Symfony/Bridge/Twig/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Bridge/Twig/Extension/FormExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function getFunctions()
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'),
];
}

Expand Down Expand Up @@ -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;
}
0