Custom tag processing reserves the
holding a collection of custom tag attributes. If
collection, ColdFusion generates a template exception.
The following example uses an
<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
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
•
Template encoding
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
Encoding custom tags
You can use the command-line utility
default, the utility is installed in the cf_root/bin directory. It is especially useful for securing
custom tag code before distributing it.
attributecollection
attributecollection
is to pass the entire Attributes scope of one custom tag to
Chapter 16, "Securing Applications," on page
cfencode
attribute to refer to the structure
attributecollection
attribute to pass two of four attributes:
345.
to encode any ColdFusion application page. By
does not refer to such a
Managing custom tags
181
Need help?
Do you have a question about the COLDFUSION MX 61-DEVELOPING COLDFUSION MX and is the answer not in the manual?
Questions and answers