Adobe COLDFUSION 9 Manual page 224

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Building Blocks of ColdFusion Applications
You can access the body text within the custom tag using the
contains all body text passed to the tag. You can modify this text during processing of the tag. The contents of the
thisTag.GeneratedContent
The
thisTag.GeneratedContent
during start tag processing is not considered part of the tag's generated content.
A custom tag can access and modify the generated content of any of its instances using the
thisTag.GeneratedContent
body of a custom tag. The content includes all text and HTML code in the body, the results of evaluating ColdFusion
variables, expressions, and functions, and the results generated by descendant tags. Any changes to the value of this
variable result in changes to the generated content.
As an example, consider a tag that comments out the HTML generated by its descendants. Its implementation could
look as follows:
<cfif thisTag.ExecutionMode is 'end'>
<cfset thisTag.GeneratedContent ='<!--#thisTag.GeneratedContent#-->'>
</cfif>
Terminating tag execution
Within a custom tag, you typically perform error checking and parameter validation. As part of those checks, you can
choose to abort the tag, using
The
tag also terminates execution of a custom tag. However, the
cfexit
flexibility when coding custom tags than
continues. The
tag can specify that processing continues from the first child of the tag or continues
cfexit
immediately after the end tag marker.
You can also use the
method
to act as high-level iterators, emulating
The following table summarizes
Method attribute value
ExitTag
(default)
ExitTemplate
Loop
Nesting custom tags
A custom tag can call other custom tags from within its body text, thereby nesting tags. ColdFusion uses nested tags
such as
and
cfgraph
cfgraphdata
allows you to provide similar functionality.
variables are returned to the browser as part of the tag's output.
variable is always empty during the processing of a start tag. Any output generated
variable. In this context, the term generated content means the results of processing the
, if a required attribute is not specified or other severe error is detected.
cfabort
. The
cfabort
cfexit
attribute to specify that the tag body executes again. This capability enables custom tags
behavior.
cfloop
behavior:
cfexit
Location of cfexit call
Base page
ExecutionMode=start
ExecutionMode=end
Base page
ExecutionMode=start
ExecutionMode=end
Base page
ExecutionMode=start
ExecutionMode=end
,
and
cfhttp
cfhttpparam
Last updated 8/5/2010
thisTag.GeneratedContent
tag is designed to give you more
cfexit
tag's
attribute specifies where execution
method
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
, and
and
cftree
cftreeitem
219
variable. The variable
. The ability to nest tags

Advertisement

Table of Contents
loading

Table of Contents