>Another issue I've run into is how to help my calling page find
>my cfc's.  While learning, I've just placed the cfc in the same
>folder as the calling page.  But now I'm placing them in a components
>folder and the calling page can't find it.

Rick, I mostly initialize them in application scope in Application.cfc

Like this:

<cfset APPLICATION.reportDAO = 
CreateObject("component","cfcs.reportDAO").init(dsn=APPLICATION.dsn)> 

Then build a constructor in your cfc like so:

<cffunction name="init" access="public" returntype="reportDAO" output="false"
         hint="Returns an instance of the CFC initialized with the correct 
settings.">
  <cfargument name="dsn">
  <cfset variables.dsn = arguments.dsn>
  <cfreturn this>
</cffunction>

Once you do all that, it's ready to use anywhere in the application. 

Just refer to it using the application scope:

<cfset getReport = APPLICATION.reportDAO.monthEnd()>

Puttin it in a cfc's directory is lame, but I'm sure more advice will roll in 
for ya.  :)

hth,
Will 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

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

Reply via email to