Skip to content

Latest commit

 

History

History
39 lines (30 loc) · 690 Bytes

README.md

File metadata and controls

39 lines (30 loc) · 690 Bytes

How to look like

Setup:

composer require tobur/gedmo-translation-form

Add to config parameters:

locales:
  - ua
  - en
default_locale: ua

To twig:

twig:
  form_themes:
    - 'GedmoTranslationFormBundle:Form:translatable.html.twig'

How to use in Sonata "configureFormFields":

        $formMapper->add(
            'name',
            TranslationType::class,
            [
                'required_locales' => ['en'],
                'type' => TextType::class,
            ]
        );

        $formMapper->getFormBuilder()->setData($this->getSubject());