Symfony Medianova CDN Integration

Symfony is an open-source PHP MVC web application framework. Thanks to the Assetic feature, CSS, JavaScript, and images can be organized in a much easier and more organized way. In this article, we discuss the process of enabling Medianova CDN for your Symfony applications. The only need for integration is to set the base URL of your assets.

  1. First, create the account for Small and Large asset in panel.medianova.com
  2. And then define the base URL app/config/config.yml config file
    • Symfony 2.6
      framework:
          templating:
              assets_base_urls:
                  http: ['http://img-medianova.mncdn.com']
    • Symfony 2.7
      framework:
          assets:
              base_urls: ['http://img-medianova.mncdn.com']
      
  3. Add your assets like this
    <img src="{{ asset('image.jpeg') }}" alt="Medianova " >
  4. Check in the HTML source code if the URL of your assets is pointing correctly to Medianova CDN

 

Was this post helpful?