Skip to content

Commit 6006484

Browse files
[Form] EnumType Mentioning array keys of choices
Page: https://symfony.com/doc/6.4/reference/forms/types/enum.html#choices Feature is added in symfony/symfony#61928 - so you probably want to merge this only when that PR has been released.
1 parent 9a4a08d commit 6006484

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

reference/forms/types/enum.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,13 @@ option to explicitly define which options to display::
119119
],
120120
]);
121121

122+
You can add keys to the `choices` array, which will then be used as labels::
123+
124+
'choices' => [
125+
'Align to the right' => TextAlign::Left,
126+
'Align to the left' => TextAlign::Right,
127+
],
128+
122129
.. include:: /reference/forms/types/options/choice_attr.rst.inc
123130

124131
.. include:: /reference/forms/types/options/choice_filter.rst.inc

0 commit comments

Comments
 (0)