><cfcomponent>
> <cfinclude template="someFunction.cfm">
> <cfinclude template="someOtherFunction.cfm">
></cfcomponent>
>...works just fine,
Err... Only to a point.
When you include functions like that, they are actually treated as
CFC-local UDFs, rather than methods.
The problem with this manifests itself if you have a subclass (well: a
CFC that extends another one... Let's forget the OO parlance, as it
hardly applies to CF) which includes code that attempts to overload a
base CFC's methods. It don't work.
This is apparently by design (search the archives here for the last time
it was discussed).
But you can see this for yourself easily enough:
<!--- base.cfc --->
<cfcomponent>
<cffunction name="foo">
<cfreturn />
</cffunction>
</cfcomponent>
<!--- sub.cfc --->
<cfcomponent extends="base">
<cfinclude template="methods.cfm">
</cfcomponent>
<!--- methods.cfm --->
<cffunction name="foo">
<cfreturn />
</cffunction>
<!--- test.cfm --->
<cfset oSub = createObject("component", "sub")>
Adam
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).
An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]