euzeoCDNPlugin - 0.1.1

Helper for Parallel Content Delivery

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to the Plugins Home

Signin


Forgot your password?
Create an account

Tools

Stats

advanced search
Information Readme Releases Changelog Contribute
Show source

euzeoCDN plugin

The euzeoCDNPlugin is a symfony plugin that provides an helper for parallel content delivery of image or other files.

This idea of this plugin came after reading this blog entry : http://www.saynotoflash.com/archives/symfony-parallel-content-delivery/

Installation

  • Install the plugin

    $ symfony plugin:install euzeoCDNPlugin
    
  • Clear you cache

    $ symfony cc
    

Configuration

To secure a symfony application:

  • Enable the helpereuzeoCDN in settings.yml

    all:
        .settings:
          enabled_helpers: [..., euzeoCDN]
  • Add your CDN domains in app.yml:

    all:
        euzeo_cdn_plugin:
          domains: [static1.domain.com, static2.domain.com, static3.domain.com]

Use it

  • To get the url of a file :

    echo euzeo_cdn_url('path/to/a/static/file')
  • To get the image tag

    echo euzeo_cdn_image_tag('path/to/my/image')
  • You can also add options to the image tag :

    echo euzeo_cdn_image_tag('path/to/my/image', array('alt' => 'A sample image')