|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
cfscript and methods
When creating an instance of an object (component) within cfscript howCutter (CF-Talk) 05/17/04 06:00 P Exactly as you proposed:Barney Boisvert 05/17/04 06:05 P >When creating an instance of an object (component) within cfscript howDave Carabetta 05/17/04 06:04 P When creating an instance of an object (component) within cfscript how would I call a method of that object using arguments[ie: myobject.init(ID);]? It's pretty straight forward using cfinvoke, but I'm not finding much documentation on component manipulation with cfscript... Cutter Exactly as you proposed: <cfscript> obj = createObject("component", "path.to.component"); obj.init(application.dsn); imageList = obj.getImageListForSite(attributes.siteID); </cfscript> Cheers, barneyb ----- Excess quoted text cut - see Original Post for more ----- >When creating an instance of an object (component) within cfscript how >would I call a method of that object using arguments[ie: >myobject.init(ID);]? It's pretty straight forward using cfinvoke, but >I'm not finding much documentation on component manipulation with >cfscript... > <cfscript> Variables.myObject = createObject("component", "path.to.my.CFC"); Variables.myObject.init( customerID:ID, secondArgument:Value2 ); </cfscript> I believe you can also use "=" as your separator (customerID=ID), but the ":" is just what I've gotten used to. Regards, Dave.
|
May 21, 2013
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||