您需要将控制器作为服务调用,以及您的路由,如下所示:
hello: pattern: /hello defaults: { _controller: acme.hello.controller:indexAction }
请参阅文档章节 如何将控制器定义为服务 。