I'm using a common set of javascript across several Symfony modules. I'd like to output the current module url-key as a javascript variable, so the javascript can use it to construct urls for various AJAX calls. I can't find where to get it, though.
$sf_context->getModuleName();
returns the module name, but not how it appears in the URL. I get that I could parse the module name from window.location, but that not only seems a bit crude, but I will soon have a case where I construct a url to a different module than the one that generated the current page.
How does one get the URL-key for the current (or given) module? Surely that mapping exists for the front controller.