Run CSS file through Twig when using {% stylesheets %} tag in Twig with Symfony2

前端 未结 2 2119
甜味超标
甜味超标 2021-02-14 07:01

I\'m including CSS stylesheets in my template like so:

{% stylesheets
    \"@SomeBundle/Resources/assets/css/default.css.twig\"
    \"@SomeBundle/Resources/asset         


        
2条回答
  •  滥情空心
    2021-02-14 07:34

    You could do it if you load the css as an internal stylesheet. Something like this:

    {% block stylesheets %}
        {{ parent() }}
        {% include 'AcmeBundle:Bundle:mycss.css.twig' %}
    {% endblock %}
    

    And then the mycss.css.twig template would contain:

    
    

提交回复
热议问题