Yes you can,

We do this via Application.cfc, using the following technique. The udf.cfm
has all the common functions.

        <!--- Request --->
        <cffunction name="onRequest" returnType="void" output="true">
                <cfargument name="targetPage" type="string" required=true/>
                <cfinclude template="#arguments.targetPage#">
        </cffunction>
        
        <cfinclude template="/base/udf.cfm" />
                
</cfcomponent>

Regards
Dale Fraser

http://learncf.com

-----Original Message-----
From: Nicholas Vacek [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, 30 October 2007 7:49 AM
To: CF-Talk
Subject: Adding custom functions to core

Is there a way to add custom functions to ColdFusion, so that I can 
reference them without having to put them in a cfc or cfm page?

For instance, I've written a simple, user-defined function. But I don't 
want to save it in the Application or Request scope, because it needs to 
be available within my CFCs - And I don't want to pass the function into 
every CFC, because that's a pain.

I want my function to be available _everywhere_ within my application, 
just like a normal function. In fact, I'd like it if my function was 
available everywhere to every application, on my server. Is this 
possible? Has anyone ever hacked the ColdFusion core to add their own 
custom functions?

-- 
Nicholas Vacek
Vivid Image - Programmer
320-587-8974 ext. 111
[EMAIL PROTECTED]
http://www.vimm.com




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:292291
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