TranslatableChoiceType

Class TranslatableChoiceType adds translatable choice types with custom inner type to forms. Language selection uses a dropdown.

Type options

Option Type Default value Description

Code example

$builder->add('template', TranslatableChoiceType::class, [
    'label' => $this->trans('Template', 'Admin.Shopparameters.Feature'),
    'hint' => $this->trans('Select an email template that will be sent after setting this status.', 'Admin.Shopparameters.Help'),
    'required' => false,
    'choices' => $this->templates,
    'row_attr' => $this->templateAttributes + [
        'class' => 'order_state_template_select',
    ],
    'button' => [
        'label' => $this->trans('Preview', 'Admin.Actions'),
        'icon' => 'visibility',
        'class' => 'btn btn-primary',
        'id' => 'order_state_template_preview',
    ],
])