Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Form] Added FormView::getRoot #20369

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

Closed
wants to merge 1 commit into from
Closed

[Form] Added FormView::getRoot #20369

wants to merge 1 commit into from

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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.