Ben Nadel
On User Experience (UX) Design, JavaScript, ColdFusion, Node.js, Life, and Love.
I am the chief technical officer at InVision App, Inc - a prototyping and collaboration platform for designers, built by designers. I also rock out in JavaScript and ColdFusion 24x7.
Meanwhile on Twitter
Loading latest tweet...
Ben Nadel at the New York ColdFusion User Group (Feb. 2008) with:

CFModule Works With Non-CFM Files

By Ben Nadel on
Tags: ColdFusion

The other day, I was recoding some work that involved ColdFusion files being called using CFModule. I had gotten it to the point where the new code was in place, but was breaking. I had the old code stored as a .BAK file. I wanted to test to see if the new code was breaking or if the old code would have broken also, but I didn't want to rename any files to make this test happen. Just for fun, not so much thinking it would work, I tried to use the .BAK file directly into the CFModule tag as such:

  • <!--- Run BAK file using CFModule. --->
  • <cfmodule
  • template="./tag.cfm.bak"
  • />

Much to my delight, this ran without a problem. Not much of a tip, but I think this is useful when you are debugging code and you want to compare one set of code to a backed up set of code.

Moral of the store: just as with CFInclude, CFModule does not care about file extensions.

Tweet This Interesting post by @BenNadel - CFModule Works With Non-CFM Files Thanks my man — you rock the party that rocks the body!

Looking For A New Job?

100% of job board revenue is donated to Kiva. Loans that change livesFind out more »

Reader Comments

I suppose that's because everything is already running (and being parsed) by the CF engine. You could use any file extension and it'll probably work.

Of course everything operates as a 'custom tag' would, including doubling the output if you close the cfmodule etc

Reply to this Comment

Off topic from the post, but possibly useful to the previous comment, I believe that Sean Corfield was working on a project to handle PHP files within Coldfusion using a java library. Might be work looking at if that's something you need.

Reply to this Comment

I use that from time to time on .sql files, when i have a REALLY complicated SQL query.

It's easier to build it in an .sql file, let Query Analyzer check it for syntax/QA, then just have ColdFusion call the very same .sql file when it's ready for my app to use. Saves a bit of copy/paste work. :)

Reply to this Comment

Post A Comment

You — Get Out Of My Dreams, Get Into My Comments
Live in the Now
Oops!
Comment Etiquette: Please do not post spam. Please keep the comments on-topic. Please do not post unrelated questions or large chunks of code. And, above all, please be nice to each other - we're trying to have a good conversation here.