I have a layout.html.twig with:
{% block js %}
{% javascripts
'Resources/public/js/jquery/jquery-1.7.1.min.js'
'Resources/public/js/jquery/jquery.namespace.js'
%}
<script src="{{ asset_url }}" type="text/javascript"></script>
{% endjavascripts %}
{% endblock %}
And I have index.html.twig with
{% extends "MichaelMikeBundle::layout.html.twig" %}
{% block js %}
{{ parent() }}
{% javascripts
'@MichaelStoreBundle/Resources/public/js/index.js'
'Resources/public/js/jqueryui/jquery.ui.core.js'
'Resources/public/js/jqueryui/jquery.ui.widget.js'
'Resources/public/js/jqueryui/jquery.ui.button.js'
%}
<script src="{{ asset_url }}" type="text/javascript"></script>
{% endjavascripts %}
{% endblock %}
I production mode page returns two js files (two requests). Symfony2 merges two files from layout and outputs as one request and it does the same for index - it merges 4 files and outputs as another request.
My question is: Is is possible to have layout and index files like in my example output all js as one request? Or at least append javascripts from index file into layout...
Thanks for any help guys!