chieroz
chieroz

Reputation: 63

A2Lix Translation Form in Sublime3

I am developing a multilanguage site in Symfony3 with KnpDoctrineExtension and a2lix/translation-form-bundle.

I followed the documentation both for KNP and A2Lix: controller and entities are OK but when I try to build and render the form I get a 500 error

Could not load type "a2lix_translations"

All the examples I found are from projects in Symfony2 so I am wondering if this is an issue related to the version I am using.

I loaded the bundle in app\AppKernel.php

new Knp\DoctrineBehaviors\Bundle\DoctrineBehaviorsBundle(),
new A2lix\TranslationFormBundle\A2lixTranslationFormBundle(),

and I added the following lines in app\config\config.yml

a2lix_translation_form:
    locale_provider: default
    locales: [br, it, ru]
    default_locale: en
    required_locales: [br, it]
    manager_registry: doctrine
    templating: "A2lixTranslationFormBundle::default.html.twig"

Thank you for your attention and for your help.

Upvotes: 0

Views: 481

Answers (2)

Za Rech
Za Rech

Reputation: 96

in sf3 you have to add :

use A2lix\TranslationFormBundle\Form\Type\TranslationsType;

and then use this:

$builder->add('translations', TranslationsType::class);

instead of :

$builder->add('translations', 'a2lix_translations');

Upvotes: 0

chieroz
chieroz

Reputation: 63

I can confirm that the stable version 2.* works fine with KNP doctrine behaviors bundle and Symfony 3.1.

Check demo provided by the author of the form bundle.

Upvotes: 1

Related Questions