I understand that in ColdFusion, explicit scoping is a Good Thing. Since learning this, I try to explicitly scope all variables, even for variables like queries, for example, <cfquery name="local.myQuery">
or <cfquery name="variables.myQuery">
.
My question is how to do explicit scoping when defining a function inside a .CFM page, which will be used only on the same page. Can I do <cffunction name="variables.myFunction">
or something similar?
Posting my own answer with what I've found so far. The link from @Ageax's comment led me to this ColdFusion documentation on Specifying the scope of a function. It says:
The way I understand this, it means that I should simply use
<cffunction name="myFunction">
to define the function, but I should use explicit scoping when calling it, likevariables.myFunction()
.