Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 689f52e

Browse filesBrowse 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
Copy full SHA for 689f52e

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed

‎reference/forms/types/choice.rst

Copy file name to clipboardExpand all lines: reference/forms/types/choice.rst
+1-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.