ColdFusion Markup Language - Custom Tags

Custom Tags

CFML allows language extensions in the form of custom tags, which are tags created by the developer that are not part of the CFML language itself. Custom tags are regular CFML files which are intended to be invoked as tags, although it is possible to treat a template as both a custom tag and a regular template. Custom tags are written in CFML and are typically invoked by prefixing the custom tag's file name with cf_, although there are other ways to invoke custom tags.

If a template is invoked as a custom tag, the attributes used to invoke that tag are available within the tag in a special attributes structure and the variables contained in the calling page are accessible via the caller structure.

For example, if writing an add tag which takes two attributes and adds them together, the sum.cfm page would look like this:

Assuming the template and tag are in the same directory, the tag can be invoked thus:

CFX tags are custom tags which are developed using Java or C++, and are prefixed with cfx_ just like cf_. Java and C++ tags are added to the CFML runtime environment using the CFML engine's administrator or by editing configuration files.

On some CFML engines JSP tags can also be included in CFML pages using the tag.

Read more about this topic:  ColdFusion Markup Language

Famous quotes containing the words custom and/or tags:

    Parents fear lest the natural love of their children may fade away. What kind of nature is that which is subject to decay? Custom is a second nature which destroys the former. But what is nature? For is custom not natural? I am much afraid that nature is itself only a first custom, as custom is a second nature.
    Blaise Pascal (1623–1662)

    So much for Mrs. Hollis’ nine months of pain and 20 years of hope.
    Alvah Bessie, Ranald MacDougall, and Lester Cole. Raoul Walsh. Nameless GI, Objective Burma, cutting dog tags off a dead GI (1945)