Coffeescript and CakePHP

Is there an easy way to use Coffeescript with CakePHP? Rails has Barista , but I could not find anything like it for CakePHP. Ideally, something transparent that will compile coffeescript into javascript on demand, and only when it changes.

The Google results for CakePHP and Coffeescript show a lot of talk about a collision between the cake team, but not much to use together. Has anyone found anything? Or maybe ideas on how I can implement such a plugin myself?

+4
source share
2 answers

I know that this is not the answer you are looking for, but I usually process it with a build script, either in Bash or in Rake (yes, Rake, great for creating PHP projects) that compiles, integrates and compresses my .coffee files for production. During development, I use coffee -w to compile .coffee files on the fly.

You can automate this by adding a post-commit to Git or Subversion afterwards, if you like.

You must upgrade the Mark Story Asset Compress plugin to compile on the go.

+5
source

You can look at kohana-coffeescript , which, as far as I know, is the only project that does what you want in PHP. Although the project is nominally intended for the Kohana framework, it is fairly easy to fork and adapt to CakePHP.

0
source

All Articles