Title: Re: [CFCDev] Initiating an Object within a CFC
On 16/01/04 17:43, "sean" <[EMAIL PROTECTED]> wrote:

This is a simple question but I must ask it.
 
I am creating a marketing email cfc and using composition to call it various other objects (i.e. see content).
In my previous application I would initialize my variables through the following lines
 
<cfset variables.highBid = 0 />
 
For a “simple” data type, that is fine, but how about for an object ? Can I do the following and still be within the rules and regulations of OO parlay?
 
<cfset variables.auctionListing = createObject(‘Component’,’Marketing.Auction_Listing’) />
 
Any help is appreciated?
 
Thanks,
 
Sean Scott


You can try this:
<cfset variables.auctionListing = createObject(‘Component’,’Marketing.Auction_Listing’).init(initArgs=Initstructyouwanttopass) />

And you create an init() function inside Marketing.Auction_Listing that have <cfreturn this /> with returntype=”Marketing.Auction_Listing” in its declaration
That’s all

Denis Lamotte

Reply via email to