php – 与@Annotation无关的Symfony2 ParamConverter(任何文件更
发布时间:2020-12-13 13:43:56 所属栏目:PHP教程 来源:网络整理
导读:我有一个Controller,它使用路由,方法,模板和ParamConverter的注释. 如果我对下一页上的文件进行任何更改(甚至是空白更改或注释),则会发生以下错误 Cannot import resource "/home/sites/MySite/src/Acme/Bundle/MyBundle/Controller/" from "/home/sites/MyS
我有一个Controller,它使用路由,方法,模板和ParamConverter的注释.
如果我对下一页上的文件进行任何更改(甚至是空白更改或注释),则会发生以下错误 Cannot import resource "/home/sites/MySite/src/Acme/Bundle/MyBundle/Controller/" from "/home/sites/MySite/app/config/routing.yml". FileLoaderLoadException: Cannot import resource "/home/sites/MySite/src/Acme/Bundle/MyBundle/Controller/" from "/home/sites/MySite/app/config/routing.yml" AnnotationException: [Semantical Error] The class "SensioBundleFrameworkExtraBundleConfigurationParamConverter" is not annotated with @Annotation. Are you sure this class can be used as annotation? If so,then you need to add @Annotation to the _class_ doc comment of "SensioBundleFrameworkExtraBundleConfigurationParamConverter". If it is indeed no annotation,then you need to add @IgnoreAnnotation("ParamConverter") to the _class_ doc comment of method AcmeBundleMyBundleControllerDefaultController::viewAction(). 如果我清除缓存,那么它将再次工作,但只有在我做了另一次更改之后,它才会再次发生.
啊,这是一个已知的bug,已在FrameworkExtraBundle中修复.
https://github.com/symfony/symfony/issues/7283 现在要获取最新版本,只需将该库的需求更改为dev-master即可 "require": { ... "symfony/symfony": "2.2.*","sensio/framework-extra-bundle": "dev-master",... }, 并运行composer update (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |