Php Smfony2:尝试使用可翻译行为扩展时出错
我试图在我的项目中使用可翻译行为,我逐字按照文档说明如何配置和使用此行为,但我遇到了以下错误: 关键-未捕获的PHP异常ReflectionException:“属性区域设置不存在”,位于C:\wamp\www\Symfony\vendor\gedmo\doctrine extensions\lib\gedmo\translateable\translateablelistener.PHP第296行 有人能帮忙吗? 提前感谢:) 编辑: 这是第296行:Php Smfony2:尝试使用可翻译行为扩展时出错,php,symfony,Php,Symfony,我试图在我的项目中使用可翻译行为,我逐字按照文档说明如何配置和使用此行为,但我遇到了以下错误: 关键-未捕获的PHP异常ReflectionException:“属性区域设置不存在”,位于C:\wamp\www\Symfony\vendor\gedmo\doctrine extensions\lib\gedmo\translateable\translateablelistener.PHP第296行 有人能帮忙吗? 提前感谢:) 编辑: 这是第296行: $reflectionProperty
$reflectionProperty = $class->getProperty(self::$configurations[$this->name][$meta->name]['locale']);
在我的例子中,所需的
$locale
字段是在实体的抽象超类中定义的-这基本上是好的,但是,它不能是私有的,但至少是受保护的。您是否在config.yml
中打开了翻译?尝试var\u dump
self::$configurations。当然,您有$locale代码>可翻译类中的属性?