Skip to content

Instantly share code, notes, and snippets.

@adamcameron
Created January 5, 2022 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamcameron/7c6d5cc4908b3ede5edc0019783670c4 to your computer and use it in GitHub Desktop.
Save adamcameron/7c6d5cc4908b3ede5edc0019783670c4 to your computer and use it in GitHub Desktop.
Demonstrating behaviour variation when getCurrentTemplatePath is called from file included in CFC vs CFM
component {
include "m.cfm";
}
<cfinclude template="m.cfm">
<cfscript>
function f() {
writeDump(getCurrentTemplatePath())
}
</cfscript>
<cfscript>
o = new C()
o.f()
</cfscript>
<cfinclude template="i.cfm">
<cfset f()>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment