-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Closed
Description
The PR #1951 "[Form] Added form type "entity_identifier" has been open for ages now. The number of supporters alone justifies its existence, but I think the requested functionality should be solved in a more generic way.
I think that we should add two new options widget and delimiter to ChoiceType.
widgetcan be one of the valuesselect,checkbox,radioandtextdelimitercan be any single character
The option expanded would be deprecated. I think having a widget and an expanded option at the same time is inconsistent.
Behavior:
widget = 'select': This is equivalent toexpanded = falseright now.widget = 'checkbox':multiplemust not be set to false. Otherwise equivalent toexpanded = true.widget = 'radio':multiplemust not be set to true. Otherwise equivalent toexpanded = true.widget = 'text': A text input is shown.- if
multipleis false, the input must equal one of the predefined choices. - if
multipleis true, the input is split by the character defined indelimiter(a comma by default), then each value is trimmed (unlesstrimis false). Each resulting input must equal one of the predefined choices.
- if
raffomania, DHoogland, ro0NL, florianrusch and Gregwar