Warning: You are browsing the documentation for PrestaShop 8, which is outdated.

You might want to read an updated version of this page for the current version, PrestaShop 9. Read the updated version of this page

Learn how to update to the latest version.

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, [
    'hint' => sprintf(
        '%s<br>%s',
        $this->trans('Only letters, numbers and underscores ("_") are allowed.', 'Admin.Shopparameters.Help'),
        $this->trans('Email template for both .html and .txt.', 'Admin.Shopparameters.Help')
    ),
    'required' => false,
    'choices' => $this->templates,
    'row_attr' => $this->templateAttributes,
])