Adobe COLDFUSION 9 Manual page 222

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Building Blocks of ColdFusion Applications
Variable
Description
Contains the execution mode of the custom tag. Valid values are "start", "end", and "inactive".
ExecutionMode
HasEndTag
Distinguishes between custom tags that are called with and without end tags. Used for code validation. If the
user specifies an end tag,
Specifies the content that the tag generates. This content includes anything in the body of the tag, including
GeneratedContent
the results of any active content, such as ColdFusion variables and functions. You can process this content as
a variable.
AssocAttribs
Contains the attributes of all nested tags if you use
For more information, see
The following example accesses the
<cfif thisTag.ExecutionMode is 'start'>
Handling end tags
The preceding examples of custom tags reference a custom tag by using just a start tag:
<cf_date>
In this case, ColdFusion calls the custom tag page date.cfm to process the tag.
However, you can create custom tags that have both a start and an end tag. For example, the following tag has both a
start and an end tag:
<cf_date>
...
</cf_date>
ColdFusion calls the custom tag page date.cfm twice for a tag that includes an end tag: once for the start tag and once
for the end tag. As part of the date.cfm page, you can determine if the call is for the start or end tag, and perform the
appropriate processing.
ColdFusion also calls the custom tag page twice if you use the shorthand form of an end tag:
<cf_date/>
You can also call a custom tag using the
<cfmodule ...>
...
</cfmodule>
If you specify an end tag to
cfmessagebox
Determining if an end tag is specified
You can write a custom tag that requires users to include an end tag. If a tag must have an end tag provided, you can
use
in the custom tag page to verify that the user included the end tag.
thisTag.HasEndTag
For example, in date.cfm, you could include the following code to determine whether the end tag is specified:
<cfif thisTag.HasEndTag is 'False'>
<!--- Abort the tag--->
<cfabort showError="An end tag is required.">
</cfif>
HasEndTag
is set to
"High-level data
exchange" on page 221.
variable of the
ExecutionMode
tag, as shown in the following example:
cfmodule
, then ColdFusion calls your custom tag as if it had both a start and an end tag.
Last updated 8/5/2010
true
; otherwise, it is set to
false
.
cfassociate
to make them available to the parent tags.
structure from within a custom tag:
thisTag
217

Advertisement

Table of Contents
loading

Table of Contents