Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

CakePHP helper to link to assets from a dedicated asset server

branch: master

This branch is 0 commits ahead and 0 commits behind master

Fetching latest commit…

Cannot retrieve the latest commit at this time

README.md

CAKEPHP CDN/Clould Front helper

Inspired by: Amazon's Cloud Front

And RoR's asset host helper: RoR's api docs :{

(Please read the above link for a detailed explanation of what's going on here)

Instead of using Javascript or HTML helpers, you can use the provided Cf (Cloud Front) helper to create links to assets, you can now use:

  • $cf->image();
  • $cf->jsLink();
  • $cf->css();

All options are exactly the same as default CakePHP helpers.

We make an assumption that local file system mirrors the remote one (on S3/Cloud Front/etc.)

The only settings you need to be concerned about are:

  • $assetHost = 'assets%d.example.com';
  • $numHostsMin = 0;
  • $numHostsMax = 3;
  • $sslHost = 'sslhost.example.com';

** Be sure to replace the above values in the helper to match your setup **

For any questions please contact me at the relevant blog post: Over here

Your input is greatly appreciated.

Something went wrong with that request. Please try again.