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

[Form] Add option "widget" to ChoiceType #6602

Copy link
Copy link
Closed
@webmozart

Description

@webmozart
Issue body actions

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 values select, checkbox, radio and text
  • 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 to expanded = false right now.
  • widget = 'checkbox': multiple must not be set to false. Otherwise equivalent to expanded = true.
  • widget = 'radio': multiple must not be set to true. Otherwise equivalent to expanded = 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 in delimiter (a comma by default), then each value is trimmed (unless trim is false). Each resulting input must equal one of the predefined choices.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.