KnpLabs / DictionaryBundle

Are you often tired to repeat static choices like gender or civility in your apps ?
MIT License
86 stars 24 forks source link

Radio / Dropdown rendering for dictionary field #189

Closed tacman closed 1 year ago

tacman commented 1 year ago

Since DictionaryType extends ChoiceType, I would think that it would be easy to render a form element of DictionaryType as a dropdown or a list of radio buttons, based on 'expand' or 'multiple' settings.

But it's rendering as text:

        $builder
            ->add('privacyLevel', DictionaryType::class, ['name' => 'privacy', 'expanded' => true])

The field works, it displays an error if the value isn't correct, but I'm stuck on how to create a dropdown or radio list based on the dictionary choices.

tacman commented 1 year ago

Oops, my bad. This works as expected.