Plenty of ways to do this, but I'd probably create a utilities.cfc and then
drop it into the application scope (in OnApplicationStart()).  That way,
anytime you want to use it on your site, you just call it that way. The
added benefit is if you find you have more functions liek this that you may
need, just drop them into utilities.cfc.


On 8/27/07, Chad Gray <[EMAIL PROTECTED]> wrote:
>
> I am switching an application.cfm to application.cfc.
>
> Im my application.cfm I defined a function that I used through out the web
> site.
> <cfscript>
>         function replaceQuotes(arg) {
>                 return Replace(arg, '"', "&##34;", "ALL");
>         }
> </cfscript>
>
>
> Now in the application.cfc I cannot place the function in onRequestStart I
> get an error.
>
> So now, to have this function available to the web site, I can just make a
> new function in application.cfc like this:
>
> <cffunction name="replaceQuotes">
> <cfargument name="arg" required="true">
> <cfreturn #Replace(arguments.arg, '"', '&##34;', 'ALL')# />
> </cffunction>
>
>
> Right???
>
> I just want to make sure I am doing this right and im not going to kill
> application.cfc.
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Check out the new features and enhancements in the
latest product release - download the "What's New PDF" now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:287207
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to