Reputation: 555
I am using assetic in a twig template to include a javascript file from my bundle's public folder. The problem is this JS file has URLs in it to call other pages using jQuery.
How should i handle these URLs? I could write the URLs as absolute paths - but this causes problems between the dev and prod environment, and also makes the application not very portable. What is the best way to do such things?
Upvotes: 1
Views: 288
Reputation: 1620
Maybe moving those urls to a configuration file .
that config.js can be generated via twig and contain the proper urls generated from the routing table
Upvotes: 1