Terminating Tag Execution; Access To Generated Content - MACROMEDIA COLDFUSION 4.5-DEVELOPING WEB Develop Manual

Developing web applications with coldfusion
Table of Contents

Advertisement

84

Terminating tag execution

CFEXIT terminates execution of a custom tag. CFEXIT's METHOD attribute specifies
where execution continues. CFEXIT can specify that processing continues from the
first child of the tag or continues immediately after the end tag marker.
The METHOD attribute can also be used to specify that the tag body should be
executed again. This enables custom tags to act as high-level iterators, emulating
CFLOOP behavior.
The following table summarizes CFEXIT behavior:
CFEXIT Behavior in a Custom Tag
METHOD Attribute Value
ExitTag (default)
ExitTemplate
Loop

Access to generated content

Custom tags can access and modify the generated content of any of its instances using
the ThisTag.GeneratedContent variable. In this context, the term generated content
means the portion of the results that is generated by the body of a given tag. This
includes all results generated by descendant tags, too. Any changes to the value of this
variable will result in changes to the generated content.
ThisTag.GeneratedContent is always empty during the processing of a start tag. Any
output generated during start tag processing is not considered part of the tag's
generated content.
As an example, consider a tag that comments out the HTML generated by its
descendants. Its implementation could look something like this:
Developing Web Applications with ColdFusion
Location of CFExit Call
Base template
ExecutionMode=start
ExecutionMode=end
Base template
ExecutionMode=start
ExecutionMode=end
Base template
ExecutionMode=start
ExecutionMode=end
Behavior
Acts like CFABORT
Continue after end tag
Continue after end tag
Acts like CFABORT
Continue from first child
in body
Continue after end tag
Error
Error
Continue from first child
in body

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 4.5

Table of Contents