File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,25 @@ Inherited Options
100
100
101
101
These options inherit from the :doc: `ChoiceType </reference/forms/types/choice >`:
102
102
103
+ choices
104
+ ~~~~~~~
105
+
106
+ **type **: ``array `` **default **: ``[] ``
107
+
108
+ By default, this fields displays all the cases of the related PHP enum. Use this
109
+ option to define explicitly which options to display::
110
+
111
+ use App\Config\TextAlign;
112
+ use Symfony\Component\Form\Extension\Core\Type\EnumType;
113
+ // ...
114
+
115
+ $builder->add('alignment', EnumType::class, [
116
+ 'choices' => [
117
+ TextAlign::Left,
118
+ TextAlign::Right,
119
+ ],
120
+ ]);
121
+
103
122
.. include :: /reference/forms/types/options/choice_attr.rst.inc
104
123
105
124
.. include :: /reference/forms/types/options/choice_filter.rst.inc
You can’t perform that action at this time.
0 commit comments