我在使用可翻譯擴展時遇到問題。在Symfony2中鏈中找不到原則可翻譯類
我composer.json是這樣的:
...
"doctrine/orm": "~2.2,>=2.2.3",
"doctrine/doctrine-bundle": "1.2.*",
"stof/doctrine-extensions-bundle": "@dev",
"gedmo/doctrine-extensions": "2.3.*@dev"
...
我config.yml是這樣的:
# Translatable Configuration
stof_doctrine_extensions:
default_locale: br
translation_fallback: true
orm:
default:
tree: true
translatable: true # not needed: listeners are not enabled by default
但是當我嘗試撥打這通電話:
$translatable = $em->getRepository('Gedmo\\Translatable\\Entity\\Translation');
我有這個錯誤:
The class 'Gedmo\Translatable\Entity\Translation' was not found in the chain configured namespaces Project\Portal\SampleBundle\Entity, Project\Portal\ExampleBundle\Entity, Project\Portal\CoreBundle\Entity
有誰知道發生了什麼,我該如何解決?
謝謝!
你已經註冊 「新的STOF \ DoctrineExtensionsBundle \ StofDoctrineExtensionsBundle()」,應用程序/ AppKernel.php裏面? – Sybio
我有同樣的問題,你有沒有解決方案? –
Mitchel,上面的答案工作正常。 – joaobarbosa