phpsymfonytwig

Get error while trying to load a twig filter I'm working on


After read the docs I tried my first filter but got this error

The filter "sanitize_for_image_url" does not exist in /var/www/html/src/CategoryBundle/Resources/views/Default/menu.html.twig at line 5.

What I did was:

Did I miss something else?


Solution

  • You're not telling twig about your new filter. You'll also need to modify the getFilters() method of your class.