Skip to content

Conversation

ro0NL
Copy link
Contributor

@ro0NL ro0NL commented Oct 30, 2016

Q A
Branch? "master"
Bug fix? no
New feature? yes
BC breaks? yes
Deprecations? no
Tests pass? yes
Fixed tickets comma-separated list of tickets fixed by the PR, if any
License MIT
Doc PR reference to the documentation PR, if any

Problem is the default parent options are merged into child options, however those may differ from the actual options, as those are not merged into children. To clarify;

$form = $this->createFormBuilder(null, ['method' => 'GET'])
  ->add('child', CheckboxType::class)
  ->getForm();
form.vars.method == 'GET'
form.child.vars.method == 'POST'

image

This allows for consistent access to form.root.vars.method.

I believe a BC break can happen if one named a field root. There's an issue somewhere regarding this for the parent field as well ;-)

edit: #19492 (comment)

@ro0NL
Copy link
Contributor Author

ro0NL commented Oct 30, 2016

Perhaps it should reserve this method first by deprecating the behavior.
Ie. return $this->offsetGet('root') until 4.0...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants