Symfony 2 and Bootstrap 3 Assetic Config and Base HTML Template

This doesn’t mean much standalone, but it’s here for future reference.

# Assetic Configuration
assetic:
    debug:          %kernel.debug%
    use_controller: false
    bundles:        [ ]
    java: /usr/bin/java
    filters:
        cssrewrite: ~
        cssembed:
          jar: %kernel.root_dir%/Resources/java/cssembed-0.4.5.jar
        yui_js:
          jar: %kernel.root_dir%/Resources/java/yuicompressor.jar
        lessphp:
          file: %kernel.root_dir%/../vendor/leafo/lessphp/lessc.inc.php
          apply_to: "\.less$"
    assets:
        jquery_js:
            inputs:
                - '%kernel.root_dir%/../components/jquery/jquery.min.js'
            filters: [?yui_js]
        bootstrap_js:
            inputs:
                - '%kernel.root_dir%/../vendor/twitter/bootstrap/js/transition.js'
                - '%kernel.root_dir%/../vendor/twitter/bootstrap/js/alert.js'
                - '%kernel.root_dir%/../vendor/twitter/bootstrap/js/modal.js'
                - '%kernel.root_dir%/../vendor/twitter/bootstrap/js/dropdown.js'
                - '%kernel.root_dir%/../vendor/twitter/bootstrap/js/scrollspy.js'
                - '%kernel.root_dir%/../vendor/twitter/bootstrap/js/tab.js'
                - '%kernel.root_dir%/../vendor/twitter/bootstrap/js/tooltip.js'
                - '%kernel.root_dir%/../vendor/twitter/bootstrap/js/popover.js'
                - '%kernel.root_dir%/../vendor/twitter/bootstrap/js/button.js'
                - '%kernel.root_dir%/../vendor/twitter/bootstrap/js/collapse.js'
                - '%kernel.root_dir%/../vendor/twitter/bootstrap/js/carousel.js'
                - '%kernel.root_dir%/../vendor/twitter/bootstrap/js/affix.js'
            filters: [?yui_js]
        bootstrap_less:
            inputs:
                - '%kernel.root_dir%/../vendor/twitter/bootstrap/less/bootstrap.less'
            filters: [lessphp,cssembed]

Original source from Joeri Verdeyen, slightly modified for Bootstrap 3.


< html>
< head>
    < title>{% block title %}Bootstrap 101 Template{% endblock %}< /title>
    < meta name="viewport" content="width=device-width, initial-scale=1.0">
    

    {% block stylesheets %}
        {% stylesheets '@bootstrap_less' combine=true %}
            
        {% endstylesheets %}
    {% endblock %}

    
    
< /head>
< body>

    {% block myBody %}
    {% endblock %}

    {% block javascripts %}
        {% javascripts '@jquery_js' '@bootstrap_js' filter='?yui_js' combine=true %}
            
        {% endjavascripts %}
    {% endblock %}
< /body>
< /html>

(Sorry, had to put the spaces in to get the whole thing to show. Silly WordPress. Thanks also Gzom!)