Gregwar/ImageBundle

Symfony 4 how to inject the service

jimiero opened this issue · 1 comments

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: - '%gregwar_image.cache_dir%' - '%gregwar_image.cache_dir_mode%' - '%image.handler.class%' - '@service_container' - '@assets.packages' - '@file_locator' - '%gregwar_image.throw_exception%' - '%gregwar_image.fallback_image%'

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.

Ok, found it, I have added:

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

inside my services.yaml

Hope it helps others