I'm googling and googling and can't find what I need.
How to get path to "web" directory in symfony2 in
action [no idea, i only found solution for older versions of symfony:
$sf_relative_url_root = sfContext::getInstance()->getRequest()->getRelativeUrlRoot();
I've tried also $this->get('security.context')->getRequest()->getRelativeUrlRoot(), but it doesn't work].js file
In case of .js file I do for now in twig template something like that:
<script type="text/javascript">
var asset_url="{{asset(' ')}}";
asset_url = asset_url.substr(0, asset_url.length-1);
</script>
<script href="{{asset('js/script.js')}}" type="text/javascript"></script>
is a better way?