Php Symfony2-自定义批注加载

Php Symfony2-自定义批注加载,php,symfony,annotations,Php,Symfony,Annotations,我想制作一个自定义注释,它像管线注释一样加载。我找到了注释教程,所以这不是问题所在。我的问题是加载行为 我想设置自定义注释,如下所示: customannotation: resource: "Bundle\Controller\Class" 然后我想得到一些类似RouteCollection的东西,我可以使用它。注释的加载应该在路由加载时或几乎同时发生 Symfony 2.7 PHP5.6.9您可以创建一个bundle,进行bundle配置以添加键customannotation,然

我想制作一个自定义注释,它像管线注释一样加载。我找到了注释教程,所以这不是问题所在。我的问题是加载行为

我想设置自定义注释,如下所示:

customannotation:
    resource: "Bundle\Controller\Class"
然后我想得到一些类似RouteCollection的东西,我可以使用它。注释的加载应该在路由加载时或几乎同时发生

Symfony 2.7

PHP5.6.9

您可以创建一个bundle,进行bundle配置以添加键
customannotation
,然后在bundle扩展中,您可以执行您已经知道的任何操作。配置也没有问题。唯一的问题是从类似于路由的类加载注释。您应该查看
doctor\Common\annotations\AnnotationRegistry
谢谢。我将查看AnnotationRegistry.Formatting。拼写。语法。