1
votes

I'm trying to override a vendor Twig extension,but I'm getting this error: Cannot redeclare class APY\DataGridBundle\Twig\DataGridExtension .

I have just copied the php from vendor to my bundle extension folder, rename the namespace to Acme\DemoBundle\Extension;

and then add this to my config.yml

parameters:
grid.twig_extension.class: Acme\DemoBundle\Extension\DataGridTwigExtension

following the directions from services override http://symfony.com/doc/current/cookbook/bundles/override.html

Any ideas to solve this? Thanks!

1
can“t you just rename your class ? for example "DataGridTwigExtensionOverride" - john Smith
Hi @arcovoltaico, are you trying to create a custom Twig function? - Anjana Silva

1 Answers

0
votes

Just a naive problem, I needed to clear cache !