I just tried something from within Site, passing "this" into Page, as shown below:

<cffunction name="init" access="public" returntype="Site" output="no">
        .... more stuff here ...
        <cfset setPageObj() />
        <cfreturn this />
</cffunction>

<cffunction name="setPageObj" access="public" returntype="void" output="no">
        <cfset variables.thisPage = createObject('component','Page2') />
        <cfset variables.thisPage.composeMe(this) />
</cffunction>

And on Page:

<cffunction name="composeMe" access="public" returntype="void" output="no">
        <cfargument name="thisSite" type="Site" required="yes">
        <cfset variables.thisSite = arguments.thisSite />
</cffunction>

******

It works ... as expected. I can access the methods and instance data in Site from
Page. Is this how i should be doing it? Also between Page and ContentItem?

AND! am I passing a reference to thisSite, or will i be storing a bunch of cached
instance data twice? I would assume it's a reference, but better to double check.


----------------------------------------------------------
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]

Reply via email to