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'标记
似乎config / services.yaml中的imports
不能正常工作,当我将所有服务从目录src/Resources/config/
移到config / services.yaml文件中时,它可以正常工作