I would like to use CDN along with Assetic in my Symfony2 project. I use the javascripts helper to combine multiple Javascript files:
{% javascripts '@MyBundle/Resources/public/js/file-1.js' '@MyBundle/Resources/public/js/file-2.js' %} <script src="{{ asset_url }}"></script> {% endjavascripts %}
and in my config.yml file I registered a CDN to be used in assets:
framework: templating: assets_base_urls: http: [http://my.cdn.url] ssl: [https://my.cdn.url]
When dumping, I get a combined file, but its URL is relative, not just one pointing to the CDN. For instance:
<script src="/js/c713f83.js"></script>
And this happens when combining multiple CSS files. The only way to get URLs using CDN is through asset :
<img src="{{ asset('bundles/mybundle/images/logo.png') }} ">
Is there anything that prevents Assetic from using the CDN hosts that I specified in my configuration?
source share