Skip to content
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

Form object as a child of control #1266

Open
vmakre opened this issue Jun 1, 2017 · 1 comment
Open

Form object as a child of control #1266

vmakre opened this issue Jun 1, 2017 · 1 comment
Milestone

Comments

@vmakre
Copy link

vmakre commented Jun 1, 2017

When i put var_dump of some control object I can see Form object as children with all other controls as childrens. Can I get some explanation of this ? . It is hard to debug when you see a lot of garbage in objects.

@spekary
Copy link
Member

spekary commented Jun 1, 2017

All controls have a reference to their top level parent form object as a convenience. That is all. It is redundant, since there is a global $_FORM, AND you can get to the form by moving up the parent control chain.

The form object itself has a list of all the controls, so this does create a circular reference unfortunately. I had to put some code in to prevent that from causing problems during form serialization.

Perhaps we should change this? Having this extra reference is just a convenience. Changing this may slow something down, since we will need some extra dereferences to get to the form object. But form structures usually are not very deep, so it is probably not a big deal to change it.

@spekary spekary added this to the 4.0 milestone Jun 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants