-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[Form] Add new prototype_options #16664
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, this is not finished yet. |
From my side this is finished now. But it still waits for code merge. |
nicolas-grekas
added a commit
to symfony/symfony
that referenced
this pull request
Apr 3, 2022
…lKaefer) This PR was merged into the 6.1 branch. Discussion ---------- [Form] Add prototype_options to CollectionType | Q | A | ------------- | --- | Branch? | 6.1 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | - | License | MIT | Doc PR | symfony/symfony-docs#16664 Allows defining options for the form for new entries (the prototype form) which differ from the options for the form for existing entries. My use case: I need this when using EasyAdminBundle. In the form for an entity `Person` I have a `CollectionType` for a related entity `Books`. There I can edit the `Books` that a `Person` already has and add new `Books`. The change would allow me to show (or disable, etc.) a form field in the `Book` form only when an existing `Book` is edited (and not show it when a new `Book` is added). As far as I can tell it is not a BC break to add this new option. I can provide another PR for the docs if this should get merged. Commits ------- b1d40c1 [Form] Add prototype_options to CollectionType
symfony-splitter
pushed a commit
to symfony/form
that referenced
this pull request
Apr 3, 2022
…lKaefer) This PR was merged into the 6.1 branch. Discussion ---------- [Form] Add prototype_options to CollectionType | Q | A | ------------- | --- | Branch? | 6.1 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | - | License | MIT | Doc PR | symfony/symfony-docs#16664 Allows defining options for the form for new entries (the prototype form) which differ from the options for the form for existing entries. My use case: I need this when using EasyAdminBundle. In the form for an entity `Person` I have a `CollectionType` for a related entity `Books`. There I can edit the `Books` that a `Person` already has and add new `Books`. The change would allow me to show (or disable, etc.) a form field in the `Book` form only when an existing `Book` is edited (and not show it when a new `Book` is added). As far as I can tell it is not a BC break to add this new option. I can provide another PR for the docs if this should get merged. Commits ------- b1d40c16be [Form] Add prototype_options to CollectionType
The code was merged now, so this could also be reviewed/merged. |
Michael, thanks a lot for implementing this feature and providing its docs! We've merged this into 6.1 (minor comment: we added the missing |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related PR: symfony/symfony#45605