Description
Symfony version(s) affected: All
Description
If you have a form that has a child named parent there is no possible way to access the parent variable in Twig.
How to reproduce
Create a simple form and have a child named parent. Then try in the twig template to access the actual form parent. The form.parent
returns the child.
The problem with this issue is that it is related to how twig accesses properties of an object not specifically to the form component because in PHP there will be no problem to access the parent form or the child named parent. Should I open an issue in the twig repository instead?
Note that this works the same with all other FormView
's properties vars
and children
.
I found this bug when I tried to fix this issue EasyCorp/EasyAdminBundle#2228 and more specific information can be found there.