ColdFusion Edge 2001
A Fast Track for ColdFusion Certification
International Web Services Conference & Expo East
September 23-26 in New York City
Passing a Structure
Passing a Structure
Passing a structure, or even a query, to a custom tag is also easy
Two modest challenges
refer to structurename in custom tag via name of parameter passed
Person, in example
Not name of the structure as created in caller
Emp, in example
Also, remember to use structure notation in attribute.variable references
<cfset emp = structnew()><cfset emp.fname=“charlie”><cfset emp.lname=“arehart”>
<cf_doit6 person=“#emp#”>
<CFOUTPUT> Hi, #attributes.person.fname#
#attributes.person.lname#</CFOUTPUT><br>
Hi, charlie arehart
Result to user running test6.cfm
Test6.cfm
DoIt6.cfm
Previous slide
Next slide
Back to first slide
View graphic version
Home
Speakers
Photos
CFConf Central