Skip to content

Commit 689f52e

Browse files
[Form]: Adding callable to choices
Page: https://symfony.com/doc/6.4/reference/forms/types/choice.html#choices Passing something like `MyEnum::myChoices()` to an `EnumType` works, so I guess it could be added here. Secondly: The entire `choices` option is missing at https://symfony.com/doc/current/reference/forms/types/enum.html but IMO this is a viable alternative to `choice_filter` to limit the choices to only *some* of the enum's cases.
1 parent 712707d commit 689f52e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

reference/forms/types/choice.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ Field Options
147147
choices
148148
~~~~~~~
149149

150-
**type**: ``array`` **default**: ``[]``
150+
**type**: ``array``, ``callable`` **default**: ``[]``
151151

152152
This is the most basic way to specify the choices that should be used
153153
by this field. The ``choices`` option is an array, where the array key

0 commit comments

Comments
 (0)