Documentation

7.3 Including assets

The IntegratedAssetBundle allows to include assets when you need them. Example: on a page with a form with a calendar you can include the calendar javascript files instead of adding them to the combined javascript which are loaded on every page. This keeps content pages fast.

Add inline style

{% integrated_stylesheets inline=true %}
    body { background: red; }
    p { font-size: 10px }
{% endintegrated_stylesheets %}

Add external stylesheets

{% integrated_stylesheets
    'bundles/app/css/styles.css'
    'bundles/app/css/styles2.css' %}
{% endintegrated_stylesheets %}

Prepend javascript

{% integrated_javascripts mode='prepend'
    'bundles/app/js/script.js' %}
{% endintegrated_javascripts %}

Render stylesheets

{{ integrated_stylesheets() }}  

Render javascripts

{{ integrated_javascripts() }}