-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Form] Add the EnumType #43095
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Form] Add the EnumType #43095
Conversation
fc916bc
to
aa73717
Compare
e14f102
to
51ef328
Compare
please also add a test covering the case of enums backed by integers rather than strings. |
268a8f4
to
55b0deb
Compare
Good idea, done! |
7fd97b3
to
0f08e0a
Compare
0f08e0a
to
0846cc8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 just a minor inaccuracy about what choice_value
callback should return (it's the string "value" of each choice)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very clean. Just missing a changelog entry.
Signed-off-by: Alexander M. Turek <me@derrabus.de>
0b5b2c6
to
c6edc34
Compare
Thank you @derrabus. |
Hello, We cannot do this:
but we can do this
But "molecule_name" or "v" will be display in the select field. How wan we display "Molecue Name" while havinf "molecule_name" in the field value attribute ? Eric |
For support, please refer to one of the support channels. Thank you for understanding. |
This PR adds a new
EnumType
that enables the form component to configure aChoiceType
for a native PHP enum.Example: