I’ve been googling this for long time! I need to show images on some menu hover and mouseout. The code is written in a js file. But the images path needs to be generated. Is there any way to generate image paths using something like this
{{ asset(‘bundles/mybundle/images/menu_down.png’) }}
Can FOSJsRoutingBundle used to generate image paths in js files?
Agree with Nick answer, but he forgot the “quotes” around the {{ asset(…) }}.
So it should be written like this:
if you want
window.menuDownUrlto work and not output you"undefined"