•
Inactive
Mode when the custom tag uses nested tags. For more information, see
custom tags" on page
If an end tag is not explicitly provided, ColdFusion invokes the custom tag page only once, in
Start mode.
A custom tag page named bold.cfm that makes text bold could be written as follows:
<cfif thisTag.ExecutionMode is 'start'>
<!--- Start tag processing --->
<B>
<cfelse>
<!--- End tag processing --->
</B>
</cfif>
You then use this tag to convert the text to bold:
<cf_bold>This is bolded text</cf_bold>
You can also use
<cfswitch expression=#thisTag.ExecutionMode#>
<cfcase value= 'start'>
<!--- Start tag processing --->
</cfcase>
<cfcase value='end'>
<!--- End tag processing --->
</cfcase>
</cfswitch>
Considerations when using end tags
How you code your custom tag to divide processing between the start tag and end tag is greatly
dependent on the function of the tag. However, you can use the following rules to help you make
your decisions:
•
Use the start tag to validate input attributes, set default values, and validate the presence of the
end tag if it is required by the custom tag.
•
Use the end tag to perform the actual processing of the tag, including any body text passed to
the tag between the start and end tags. For more information on body text, see
body text" on page
•
Perform output in either the start or end tag; do not divide it between the two tags.
184
Chapter 9: Creating and Using Custom CFML Tags
186.
to determine the execution mode of a custom tag:
cfswitch
185.
"Nesting
"Processing
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