-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[WIP] Bootstrapped Options Resolver Component #2353
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
Conversation
|
||
.. versionadded:: 2.1 | ||
The OptionsResolver Component is new in Symfony2.1, it can be found in the | ||
Form component in older versions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is wrong. It cannot be found anywhere in 2.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
- Review by @stof
[WIP] Bootstrapped Options Resolver Component
Hi Wouter! This is a great entry - I've merged it in with only minor changes at sha: b98619e (including removing the I did have one question - which I'll post as a line comment. Thanks! |
:method:`Symfony\\Component\\OptionsResolver\\OptionsResolver::replaceDefaults` | ||
method. This can be used to override the previous default value. The closure | ||
that is passed has 2 parameters: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this last part (starting with The closure that is passed...
) is very clear. I think we need an example here to show what you can actually do and how this closure is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add it if you (or anyone) can give me a good example (I can't find a simple good 'somewhat real use-case' example for this one).
@weaverryan thanks for merging! However, are we going to remove every |
Thank you for this great documentation! In my opinion, the example should be changed though. Entities are a very bad usage example, because entities are data holders that can change at any time. The OptionsResolver though is meant for configuring classes whose configuration does not change anymore after construction. A better example might be a |
And I'm completely aware that I gave this stupid example myself in the README file :P |
/cc @bschussek