[Top] [All Lists]

Re: application.cfc and UDFs

Subject: Re: application.cfc and UDFs
From: Ian Skinner
Date: Fri, 03 Aug 2007 10:25:23 -0700
Newsgroups: macromedia.coldfusion.cfml_general_discussion

Dan Bracuk wrote:
I don't think you can have functions inside functions.  My approach would be to 
write all your functions in a separate file and cfinclude that file in your 
onApplicationStart function.
Yes you will have to include the functions, but which method you do this
will depend on where you want these UDF to show up. During
onApplicationStart you can only set application scoped variables, during
onSessionStart you have access to application and session variables and
during onRequestStart you have access to application, session and
request variables.
IIRC there is a trick to connecting URF's through the application.cfc
file, I don't have the details in front of me, but I think it went
something like this. You defined the function, but then had to assign
it to a variable to be usable. I.E. variables.aFunction = theFunction
or something like that.

<Prev in Thread] Current Thread [Next in Thread>