Working on a website where cfc's will go in a cfc folder. In an
effort to not cause additional mappings I created a function called
newObj that I want to put in the application scope.
The easiest way to do this is to put the function in the
Application.cfc. What are peoples thoughts on a best practice for
this?
Should additional functions go in the Application.cfc or should be it
exclusive of the various onStart and onEnd functions
(onApplicationEnd, onApplicationStart, onError, onRequest,
onRequestEnd, onRequestStart, onSessionEnd, onSessionStart)?
<cffunction name="onApplicationStart" returnType="boolean" output="false">
<cfset application.newObj = newObj>
<cfreturn true>
</cffunction>
<cffunction name="newObj" access="public"
returntype="WEB-INF.cftags.component">
<cfargument name="cfc" type="string" required="true">
<cfset obj = createObject("component","cfc.#arguments.cfc#")>
<cfreturn obj>
</cffunction>
Cheers,
Sam F
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:226681
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=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54