【发布时间】:2016-03-18 14:22:55
【问题描述】:
我正在尝试在我们的小应用程序中包含 Symfony Validator 组件。但我无法让它工作。我想我把所有东西放在一起,但我总是得到一个例外。
AnnotationException in AnnotationException.php line 54:
[Semantical Error] The annotation "@Symfony\Component\Validator\Constraints\NotBlank" in property UserEntity ::$username does not exist, or could not be auto-loaded.
但是该类存在并且是自动加载的。我测试了它:AnnotationRegistry::registerLoader()。
你可以在这里找到我正在使用的代码:https://gist.github.com/anonymous/c44fc5a1068b13e9ca22
【问题讨论】:
标签: php validation symfony annotations