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.
widget
can be one of the valuesselect
,checkbox
,radio
andtext
delimiter
can 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 = false
right now.widget = 'checkbox'
:multiple
must not be set to false. Otherwise equivalent toexpanded = true
.widget = 'radio'
:multiple
must not be set to true. Otherwise equivalent toexpanded = true
.widget = 'text'
: A text input is shown.- if
multiple
is false, the input must equal one of the predefined choices. - if
multiple
is true, the input is split by the character defined indelimiter
(a comma by default), then each value is trimmed (unlesstrim
is false). Each resulting input must equal one of the predefined choices.
- if