Commit 0b9d580
committed
feature #45605 [Form] Add prototype_options to CollectionType (michaelKaefer)
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 CollectionTypeFile tree
3 files changed
+26
-1
lines changed- Extension/Core/Type
- Tests/Extension/Core/Type
3 files changed
+26
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
4 | 9 | | |
5 | 10 | | |
6 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
126 | 127 | | |
127 | 128 | | |
| 129 | + | |
128 | 130 | | |
| 131 | + | |
129 | 132 | | |
130 | 133 | | |
131 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
430 | 430 | | |
431 | 431 | | |
432 | 432 | | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
433 | 450 | | |
434 | 451 | | |
435 | 452 | | |
| |||
0 commit comments