Search code examples
symfonyassetic

Symfony dump assets from URL


I have an application that needs some assets from URL. I am importing them like:

{% block stylesheets %}
    {% stylesheets
        'http://cdnjs.cloudflare.com/ajax/libs/foundicons/3.0.0/foundation-icons.css'
        'bundles/bmatznerfoundation/css/foundation.min.css'
        'bundles/arpanetkorepeteshop/css/*'
        filter="cssrewrite"
    %}
        <link rel="stylesheet" type="text/css" href="{{ asset_url }}" />
    {% endstylesheets %}
{% endblock %}

If I dump assets

php app/console assetic:dump

it downloads the source. But if there is some imports inside the source, it don't download it.

@font-face {
    font-family: "foundation-icons";
    src: url("http://cdnjs.cloudflare.com/ajax/libs/foundicons/3.0.0/foundation-icons.eot");
}

Is there a way to download it all?


Solution

  • Short version: no. Parsing a CSS file for imports (in this case an external font file) is way beyond the scope of something like Assetic to be able to do. There are plenty of ways of hooking into Assetic if you're willing to dig around in the code and writing your own, however in this instance I would recommend just downloading the font icon pack yourself - you are after all bundling it yourself as a project dependency.