Right way to inject container service in Sonata Admin Bundle
问题 I'm trying to inject the service container in my Sonata Admin class in order to use it at configureFormFields method. This is what I have: config.yml (sonata services definition) services: tan.product.admin.product: class: Tan\ProductBundle\Admin\ProductAdmin tags: - { name: sonata.admin, manager_type: orm, group: Product, label: Product } arguments: [ null, Tan\ProductBundle\Entity\Product, @service_container] ProductAdmin.php class ProductAdmin extends Admin { /** @var \Symfony\Component