Symfony and NiftyCube

Symfony is a very nice framework for developing PHP 5 applications. NiftyCube is a very nice JavaScript/CSS solution to getting rounded corners. Unfortunately, these two won’t play nice together “out of the box.” What I discovered (after many hours of frustration) is that although niftycube.js will run without errors no matter where it’s included from, it actually tries to include some CSS from a 3rd file called niftyCorners.js. NiftyCube expects niftyCorners.js to be installed in your root directory, and it may very well not be there, because Symfony likes to keep all of your scripts in the /js directory.

To get around this problem, simply change line 37 in niftycube.js from:

l.setAttribute("href","niftyCorners.css");

to an absolute path:

l.setAttribute("href","/js/NiftyCube/niftyCorners.css");

Enjoy.

One Comment

  1. HRN
    Posted 2006-09-26 at 04:33:21 -0400 | Permalink

    Great! Good job Mike!

Post a Comment

Your email is never shared. Required fields are marked *

*
*