Skip to main content
Inspiring
May 15, 2007
Answered

Difference between Application .cfc and .cfm?

  • May 15, 2007
  • 2 replies
  • 8087 views
Title says it all. I'm a bit confused about the difference between Application.cfc and .cfm.

I understand a bit more about the .cfc, where you define methods onRequestStart, etc.
Yet in an example I'm following, they use .cfm and the <cfapplication> tag. Both seem to get called, but should I only be using one file? Or?

Also since both can be used what is the calling order by ColdFusion or is one ignored if the other is present?
This topic has been closed for replies.
Correct answer Dan_Bracuk
application.cfc gives you more control over when code runs. In an application.cfm file, all of the code in that file is processed at the start of every page request. With application.cfc you can assign bits of code to the appropriate method.

2 replies

Dan_BracukCorrect answer
Inspiring
May 15, 2007
application.cfc gives you more control over when code runs. In an application.cfm file, all of the code in that file is processed at the start of every page request. With application.cfc you can assign bits of code to the appropriate method.
Inspiring
May 15, 2007
if you have both files in the same location, only .cfc is processed.
.cfm is ignored if .cfc is found.
--

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com