Gregwar / ImageBundle

Image manipulation bundle for Symfony 2
MIT License
195 stars 50 forks source link

Symfony 4 how to inject the service #120

Closed jimiero closed 4 years ago

jimiero commented 4 years ago

Hello,

Can you let me know how to use this with symfony 4 autowire? I tried to place this:

`image.handling: class: '%image.handling.class%' public: true arguments:

Inside my services.yaml but still get this error:

Service "image.handling" not found: even though it exists in the app's container, the container inside

I tried also to use dependency injection, and still it dosn't recognize the service.

jimiero commented 4 years ago

Ok, found it, I have added:

Gregwar\ImageBundle\Services\ImageHandling: '@image.handling'

inside my services.yaml

Hope it helps others