【发布时间】:2021-09-13 18:38:28
【问题描述】:
我正在尝试在我的项目中使用可翻译行为,我逐字逐句地按照文档说明如何配置和使用此行为,但出现此错误:
CRITICAL - Uncaught PHP Exception ReflectionException: "Property locale doesn't exist" at C:\wamp\www\Symfony\vendor\gedmo\doctrine-extensions\lib\Gedmo\Translatable\TranslatableListener.php line 296
有人可以帮忙吗? 在此先感谢:)
编辑: 这是第 296 行:
$reflectionProperty = $class->getProperty(self::$configurations[$this->name][$meta->name]['locale']);
【问题讨论】:
-
你在
config.yml打开翻译了吗? -
尝试
var_dumpself::$configurations。 -
当然你的可翻译类中有
$locale;属性?