symofony4自定义路由加载器未注册

时间:2018-11-13 08:32:04

标签: symfony4

src / Resources / config / routing.yaml

services:
    _defaults:
        autowire: true
        autoconfigure: true
        public: true

    App\Routing\ResourceRouteLoader:
        arguments:
            - '@App\Metadata\Resource\Factory\ResourceMetadataFactory'
            - 'App\Action\PlaceholderAction'
            - '%simple_rest.resource_class_directories%'
        tags: [ 'routing.loader' ]

config / routes / app_rest.yaml

app_rest:
    resource: .
    type: app_rest
    prefix: /api

ResourceRouteLoader服务位于服务容器中,但没有'routing.loader'标记

enter image description here

enter image description here

enter image description here

结论

似乎config / services.yaml中的imports不能正常工作,当我将所有服务从目录src/Resources/config/移到config / services.yaml文件中时,它可以正常工作

0 个答案:

没有答案