I’m trying to dynamically load an image from a javascript file.
How I can load it using Assets (or FOSJsRoutingBundle) without having to paste my code of the .js file into the template?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
you could post PHP generated JS variable and later use it in you JS files.
for example:
in case you need this path in the section, where typically JS files are included, you can always use twig blocks.