The examples of custom tags shown so far in this chapter all reference a custom tag using just a start tag, as in:
<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 will also call 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
tag, as shown in the following example:
<cfmodule ...> ... </cfmodule>
If you specify an end tag to cfmodule
, then ColdFusion calls your custom tag as if it had both a start and an end tag.