Combining Assetic Resources across inherited templates

You can actually do the following: In layout.html.twig (or whatever your layout is) {% block stylesheets %} {% stylesheets ‘your_assets_here’ %} <link rel=”stylesheet” href=”https://stackoverflow.com/questions/6958970/{{ asset_url }}” /> {% endstylesheets %} {% endblock %} And in any template that extends that layout: {% block stylesheets %} {{ parent() }} {% stylesheets ‘additional_assets_here’ %} <link rel=”stylesheet” href=”https://stackoverflow.com/questions/6958970/{{ … Read more

Path of assets in CSS files in Symfony 2

I have came across the very-very-same problem. In short: Willing to have original CSS in an “internal” dir (Resources/assets/css/a.css) Willing to have the images in the “public” dir (Resources/public/images/devil.png) Willing that twig takes that CSS, recompiles it into web/css/a.css and make it point the image in /web/bundles/mynicebundle/images/devil.png I have made a test with ALL possible … Read more