manuelodelain / svg-twig-extension

add inline svg with twig
MIT License
18 stars 5 forks source link

Unknown "svg" function #3

Open dubitoph opened 3 years ago

dubitoph commented 3 years ago

I'm using Symfony 5.1 and I just have updated Twig from 2.14.1 to 3.1.1.

There is my configuration in "config\services.yaml" to use this extension :

...
services:
...
    manuelodelain\Twig\Extension\SvgExtension:
        class: manuelodelain\Twig\Extension\SvgExtension

I get this error : Unknown "svg" function.

dubitoph commented 3 years ago

I reinstalled twig/extensions with all dependencies and it works. But, the Twig version was downgraded to 2.14.1 and I have 2 alerts :

Package doctrine/reflection is abandoned, you should avoid using it. Use roave/better-reflection instead. Package twig/extensions is abandoned, you should avoid using it. No replacement was suggested.

tflight commented 3 years ago

This package doesn't require either of those packages as dependencies, so I'd guess that another package you have is requiring those. Check with these commands:

composer why doctrine/reflection composer why twig/extensions

That will tell you the dependency tree for those packages.

dubitoph commented 3 years ago

Ok, thank you for your help.

Effectively, it isn't this extension has need to doctrine/refection and twig/extensions :

doctrine/common 2.13.3 requires doctrine/reflection (^1.0) doctrine/persistence 1.3.8 requires doctrine/reflection (^1.2) dev-master requires twig/extensions (^1.5)

However, when I remove twig/extensions, svg function isn't recognized by Twig.