RadioWithChoiceChildrenType

Combination of a RadioType and a ChoiceType fields

Type options

Option Type Default value Description
radio_name string Name of the radio input
radio_label string Label of the radio input
child_choice array Choices available in the ChoiceType

Code example

$builder->add('themes_selectors', RadioWithChoiceChildrenType::class, [
    'radio_name' => 'themes_type',
    'radio_label' => $this->trans('Theme translations', 'Admin.International.Feature'),
    'required' => false,
    'label' => null,
    'child_choice' => [
        'name' => 'selected_value',
        'empty' => $this->trans('Select a theme', 'Admin.International.Feature'),
        'choices' => $this->excludeDefaultThemeFromChoices($this->themeChoices),
        'label' => false,
        'multiple' => false,
    ],
]);

Preview example

RadioWithChoiceChildrenType rendered in form example