Yes, you can use cfinclude, but no, you shouldn't. For two reasons:

1) When you cfinclude in a cfc method, all the local Var scoped
variables get copied to the Variables scope. Which is bad. This is
fixed in Blackstone (MACR gave me permission to blog this.)

2) You said you want to use site wide variables in a CFC. There is a
better way of doing this then cfinclude. Your CFC could have a method,
init(), that lets you pass these values in. Another way is to not use
a cfinclude for your global vars, but another CFC. I typically make a
cfc called Application, or Settings. This CFC will have one methoid,
getSettings(). My Application.cfm file will use this method to set up
the site wide variables in the Application scope. My other CFCs will
call this method to set the values in the Variables scope.


On Fri, 12 Nov 2004 16:11:33 -0800, Charles Heizer <[EMAIL PROTECTED]> wrote:
> Hello,
> I was wondering if it was possible to do a cfinclude in a cffunction
> tag?
> 
> I have a globals.cfm file which has site wide variables set and I want
> to reference them with out using cfinvokeargument tag.
> 
> I hope this make sense,
> Thanks a bunch,
> - Charles
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:184210
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to