Access currently logged in user in UserRepository in Sylius
问题 I would like to do something like this. sylius_backend_user_index: pattern: / methods: [GET] defaults: _controller: sylius.controller.user:indexAction _sylius: template: SyliusWebBundle:Backend/User:index.html.twig method: createFilterPaginator arguments: [$criteria, $sorting, $deleted, @service_container] I would like to access service_container in createFilterPaginator method. Can any one help me to sort out this issue? 回答1: First of all, no need for the whole service container, you need