User Guide

Table Of Contents
Managing custom tags 249
Custom tag processing reserves the attributecollection attribute to refer to the structure
holding a collection of custom tag attributes. If
attributecollection does not refer to such a
collection, ColdFusion generates a template exception.
The following example uses an
attributecollection attribute to pass two of four attributes:
<cfset zort=StructNew()>
<cfset zort.x = "-X-">
<cfset zort.y = "-Y-">
<cf_testtwo a="blab" attributecollection=#zort# foo="16">
If testtwo.cfm contains the following code:
---custom tag ---<br>
<cfoutput>#attributes.a# #attributes.x# #attributes.y#
#attributes.foo#</cfoutput><br>
--- end custom tag ---
its output is the following statement:
---custom tag ---
blab -X- -Y- 16
--- end custom tag ---
One use for attributecollection is to pass the entire Attributes scope of one custom tag to
another. This often happens when you have one custom tag that calls a second custom tag and
you want to pass all attributes from the first tag to the second.
For example, you call a custom tag with the following code:
<cf_first attr1="foo" attr2="bar">
To pass all the attributes of the first custom tag to the second, you include the following statement
in first.cfm:
<cf_second attributecollection="#attributes#">
Within the body of second.cfm, you reference the parameters passed to it as follows:
<cfoutput>#attributes.attr1#</cfoutput>
<cfoutput>#attributes.attr2#</cfoutput>
Managing custom tags
If you deploy custom tags in a multideveloper environment or distribute your tags publicly, you
can use the following additional ColdFusion capabilities:
Advanced security
Tem pl at e e n cod i ng
Securing custom tags
The ColdFusion security framework enables you to selectively restrict access to individual tags or
to tag directories. This can be an important safeguard in team development. For more
information, see Chapter 16, “Securing Applications,” on page 373.