Да, ко всему вышесказанному.Демонстрация:
Test.cfc:
<cfcomponent>
<cfset Variables.Instance = {} />
<cffunction name="checkTheScopeYo" returntype="Struct">
<cfset var LOCAL = {} />
<!--- Call a CFModule --->
<cfmodule template="TestModule.cfm" />
<cfset Variables.theLocal = LOCAL />
<cfreturn Variables />
</cffunction>
</cfcomponent>
TestModule.cfm:
<cfif thisTag.ExecutionMode EQ "end">
<cfset Caller.FromModule = "Set to the Variables scope" />
<cfset Caller.Instance.FromModule = "Set to the Variables.instance variable" />
<cfset Caller.Local.FromModule = "Set to the LOCAL scope" />
</cfif>
Scribble.cfm:
<cfset theResult = CreateObject("component", "Testing").checkTheScopeYo() />
<cfdump var="#theResult#">
Дамп показывает, что у вас есть доступ к локальным переменным внутри функции, а также к области действия переменных всего CFC:
struct
CHECKTHESCOPEYO:
[function]
Arguments: none
ReturnType: Struct
Roles:
Access: public
Output:
DisplayName:
Hint:
Description:
FROMMODULE: Set to the Variables scope
INSTANCE:
[struct]
FROMMODULE: Set to the Variables.instance variable
THELOCAL:
[struct]
FROMMODULE: Set to the LOCAL scope
THIS:
[component Testing]
Methods:
CHECKTHESCOPEYO
[function]
Arguments: none
ReturnType: Struct
Roles:
Access: public
Output:
DisplayName:
Hint:
Description: