Skip to content

Tobur/gedmo-translation-form

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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());