What is the proper way to assign a general udf to application.cfc?

Posted by Tom Hubbard on Stack Overflow See other posts from Stack Overflow or by Tom Hubbard
Published on 2010-03-15T18:14:09Z Indexed on 2010/03/15 18:19 UTC
Read the original article Hit count: 293

Filed under:
|

I simply want to define a function in application.cfc and expose it application wide to all requests. Preferably the "assignment" would only happen on application startup.

Is the preferred method to do something along the lines of this:

<CFCOMPONENT OUTPUT="FALSE">
<CFSET this.name = "Website">
<CFSET this.clientManagement = true>
<CFSET this.SessionManagement = true>

<CFFUNCTION NAME="GetProperty" OUTPUT="False">
    <CFARGUMENT NAME="Property">

    <CFRETURN this.Props[Property]>
</CFFUNCTION>

<CFFUNCTION NAME="OnApplicationStart" OUTPUT="FALSE">
    <CFSET Application.GetProperty = GetProperty>
.
.
.

or is there something better?

© Stack Overflow or respective owner

Related posts about cfml

Related posts about coldfusion