running an application.cfm file and all pages uses...
# cfml-general
s
running an application.cfm file and all pages uses included file which has some unscoped variables defined in the application.cfm, i want to get that included file in a cfc, but it throws error as it says the variable is undefined how can fix it, using the init when i am calling it, any quick fixes
a
Difficult to troubleshoot your code without seeing an example of what you're doing.
Yer description is not very clear either. Are you saying yer including a file from Application.cfm, and you want to include that file in a CFC too? If so... just... do that. That will work. However I suspect you are not telling us everything as I assume that's what you tried (note how I have to "assume" cos you didn't show us...)
b
Cfinclude the template from your onrequest() method and it will share the variables scope from your Application.cfc.