Closed robbanl closed 8 years ago
Of course, when I wrote it and did some more research I found the issue:
templating.helper.assets
was removed in Symfony 3.0. You should use the assets.package
service instead.Will create a pull request!
Could we simply test wether the services exist?
Maybe something like $container->has('templating.helper.assets')
Sounds like a plan! I'll give it a try!
@Gregwar PR is ready when you are :)
@Gregwar would you mind pushing a release? Currently no released version of the ImageBundle is compatible with the current Symfony 3.x because of this issue.
@Gregwar ping
Tagged v2.0.23
, is it OK?
The templating.helper.assets service was replaced in Symfony 3.0.* by assets.packages
@leperse yes, this is fixed in #93
Hello,
I'm having some troubles using this bundle in my Symfony 3 application.
Tried using
{{ image('/code/symfony/web/img/404.png').resize(100,100) }}
in the twig template, but got the error:Error: Method Gregwar\ImageBundle\ImageHandler::__toString() must not throw an exception
After some searches on Google I found that I should call jpeg() method to have a better error. Received this error:
An exception has been thrown during the rendering of a template ("You have requested a non-existent service "templating.helper.assets".") in AppBundle::default/frontpage.html.twig at line 13.
Also tried directly in the controller,
$foo = $this->get('image.handling')->open('/code/symfony/web/img/404.png')->jpeg();
but got the same error.Is it me who missed something or anything that changed in Symfony 3?