I am trying to understand how do you use jquery or other scripts in Symfony2. I read the Assets documentation, however that didnt help me that much.
So I have a base.html.twig file in which I add the jquery library and my script file that contains a simple script.
I add it like this:
{% block javascripts %}
{# Le Javascript #}
{% javascripts
'bundles/mpFrontend/assets/js/jquery-1.11.2.min.js'
'Mp/ShopBundle/Resources/js/scripts.js'
%}
<script src="{{ asset_url }}"></script>
{% endjavascripts %}
Now I have a index.html.twig in which I extend the base.html.twig.... Is that all I need? For me the script doesn’t work, do I need to somehow access it in index.html.twig too?