-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[Form] Document usage of adders and removers #1057
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
Comments
Also, the adder/remover prefixes are configurable. |
@keymaster This has changed again. See #1227 |
This should get changed in |
@wouterj I agree that we should add the |
Closing this as #2434 is merged |
As of symfony/symfony#3239 the "collection" and "choice" types (with multiple=true) as well as subtypes (such as "entity") will try to discover an adder and a remover method in your model if "by_reference" is set to false.
Example form:
The underlying article class is expected to look like this:
If adder and remover are not found, the form behaves differently depending on whether
getTags
returns an object or an array.setTags
You can force a write-back in case (1) by setting the field option "by_reference" to false. Note that in this case, adders and removers won't be used even if present! Instead, the expected object signature is
The text was updated successfully, but these errors were encountered: