Commit a216951
committed
minor symfony#7940 [Form] Fix choice keys and values for custom field types (michaelperrin)
This PR was submitted for the 3.2 branch but it was merged into the 2.7 branch instead (closes symfony#7940).
Discussion
----------
[Form] Fix choice keys and values for custom field types
Choices labels are defined as the keys of the array as of Symfony 3 (see symfony/symfony#14050).
I prefered to keep the same parameters for the "Creating your Field Type as a Service" section and call `array_flip` as I think it is clearer to keep the keys as keys (!) for parameters, especially as the labels could contain some spaces.
Commits
-------
74b662b Fix choice keys and values for custom field types1 file changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
37 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
394 | 394 | | |
395 | 395 | | |
396 | 396 | | |
397 | | - | |
| 397 | + | |
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
| |||
0 commit comments