82
Developing Web Applications with ColdFusion
Examples
Via CFMODULE
<CFSET zort=StructNew()>
<CFSET zort.X = "-X-">
<CFSET zort.Y = "-Y-">
<CFMODULE TEMPLATE="testtwo.cfm"
a="blab"
attributecollection=#zort#
foo="16">
Via shorthand
<CFSET zort=StructNew()>
<CFSET zort.X = "-X-">
<CFSET zort.Y = "-Y-">
<CF_TESTTWO a="blab" attributecollection=#zort# foo="16">
Accessing attributes within the custom tag
If
testtwo.cfm
contains this CFML:
---custom tag ---<br>
<CFOUTPUT>#attributes.a# #attributes.x# #attributes.y#
#attributes.foo#</cfoutput>
<BR>--- end custom tag ---
Its output will be:
---custom tag ---
blab -X- 12 16
--- end custom tag ---
Executing Custom Tags
Tag instance data
During the execution of a custom tag template, ColdFusion keeps some data related to
the tag instance. The ThisTag scope is used to preserve this data with a unique
identifier. The behavior is similar to the File scope.
The following variables are generated by the ThisTag scope:
•
ExecutionMode — valid values are "start" and "end."
•
HasEndTag — used for code validation, it distinguishes between custom tags
that have and don't have end tags for ExecutionMode=start. The name of the
Boolean value is ThisTag.HasEndTag.
•
GeneratedContent — can be processed as a variable.
Summary of Contents for COLDFUSION 4.5-DEVELOPING WEB
Page 1: ...Allaire Corporation Developing Web Applications with ColdFusion ColdFusion 4 5...
Page 14: ...xiv Developing Web Applications with ColdFusion...
Page 26: ...xxvi Developing Web Applications with ColdFusion...
Page 34: ...8 Developing Web Applications with ColdFusion...
Page 70: ...44 Developing Web Applications with ColdFusion...
Page 84: ...58 Developing Web Applications with ColdFusion...
Page 114: ...88 Developing Web Applications with ColdFusion...
Page 148: ...122 Developing Web Applications with ColdFusion...
Page 174: ...148 Developing Web Applications with ColdFusion...
Page 208: ...182 Developing Web Applications with ColdFusion...
Page 244: ...218 Developing Web Applications with ColdFusion...
Page 274: ...248 Developing Web Applications with ColdFusion...
Page 288: ...262 Developing Web Applications with ColdFusion...
Page 300: ...274 Developing Web Applications with ColdFusion...
Page 350: ...324 Developing Web Applications with ColdFusion...
Page 362: ...336 Developing Web Applications with ColdFusion...