Javascript,Image and Yii

I have a group of images in my frontend application(the direction is: frontend/web/resources/img/), this images are used by a javascript library but I don’t know how to pass the direction of these images through yii2 to the javascript library. Some body could help me with this.

Hi, You can create a global variable in Javascript, and you can pass direction through this var.


var path = '<?php echo $Path; ?>';