带有Stof DoctrineExtensionsBundle的A2lixTranslationFormBundle不显示任何选项卡 [英] A2lixTranslationFormBundle with Stof DoctrineExtensionsBundle doesnt Show Any Tab
本文介绍了带有Stof DoctrineExtensionsBundle的A2lixTranslationFormBundle不显示任何选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是Symfony和Sonata的新手.按照说明进行操作后,我安装了Translatable,但是我没有在表格中找到任何Tab.
I'm new to Symfony and Sonata. After following the instructions i installed Translatable, but i dont get any Tab in the form.
Composer.json
Composer.json
"stof/doctrine-extensions-bundle": "1.1.x-dev",
"a2lix/translation-form-bundle": "2.x-dev"
config.yml
config.yml
# Doctrine Configuration
doctrine:
dbal:
driver: "%database_driver%"
host: "%database_host%"
port: "%database_port%"
dbname: "%database_name%"
user: "%database_user%"
password: "%database_password%"
charset: UTF8
# if using pdo_sqlite as your database driver, add the path in parameters.yml
# e.g. database_path: "%kernel.root_dir%/data/data.db3"
# path: "%database_path%"
orm:
auto_generate_proxy_classes: "%kernel.debug%"
auto_mapping: true
mappings:
gedmo_translatable:
type: annotation
prefix: Gedmo\Translatable\Entity
dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/Entity"
alias: GedmoTranslatable # this one is optional and will default to the name set for the mapping
is_bundle: false
stof_doctrine_extensions:
default_locale: "%locale%"
orm:
default:
translatable: true
a2lix_translation_form:
locales: [es, pr] # [1]
default_required: true # [2]
manager_registry: doctrine # [3]
templating: "A2lixTranslationFormBundle::default.html.twig" # [4]
Sonata AdminClass
Sonata AdminClass
/**
* @param FormMapper $formMapper
*/
protected function configureFormFields(FormMapper $formMapper)
{
$formMapper
->add('descripcion')
->add('unidadMedida')
->add('translations', 'a2lix_translations')
;
}
推荐答案
我在尝试使用这2个捆绑包时遇到了很多麻烦,以至于我只改用了 a2lix 捆绑包,它的工作原理很吸引人我... 这就是我现在使用的(SF 2.4)
I had so much trouble trying to use those 2 bundles that I switched to using only a2lix bundles and it worked like a charm for me... This is what I am using now (sf 2.4)
"a2lix/i18n-doctrine-bundle": "dev-master",
"a2lix/translation-form-bundle": "2.*@dev",
这篇关于带有Stof DoctrineExtensionsBundle的A2lixTranslationFormBundle不显示任何选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文