I have a page with a name of
summary.cfm
inside of it:
<cfinclude template="view/totals.cfm>
view/totals.cfm
inside of it:
variables.grandTotalHTML = invoke("viewtotals, "doSummary", {...});
view/viewtotals.cfc
inside of it
<cfmodule template="summarytemplate.cfm" ...>
<!--- database is not passed in here --->
view/summarytemplate.cfm
Inside of it we have
param attributes.database = session.database;
...
databaseoverride = attributes.database;
...
<cfquery name="qData">
SELECT *
FROM [#variables.databaseoverride#]
...
</cfquery>
Now question
I don't know where the databaseoverride is coming from.
viewtotals.cfc
?(Too long for comments)
Just to elaborate on Dan's answer:
summary.cfm
VARIABLES
scope with the included template, "view/totals.cfm"view/totals.cfm
VARIABLES
scope with the parent template, "summary.cfm"view/viewTotals.cfc
Its VARIABLES
scope is not shared with any of the calling templates (summary.cfm and view/totals.cfm)
Its VARIABLES
are accessible to the cfmodule - through the CALLER
scope (as are the function's local
and arguments
scopes)
view/summaryTemplate.cfm
VARIABLES
scope with anyone. CALLER
scope. ( The REQUEST
scope is accessible to all of the scripts above.)