Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
ColdFusion Markup Language
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Custom tags == {{Unreferenced section|date=February 2017}} 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 (programming)|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 an ''attributes'' scope and the variables for the calling page are accessible via the ''caller'' scope. For example, if writing a custom tag to perform [[addition]], taking two attributes and adding them together, the tag would be an addition.cfm file which could look like this: <syntaxhighlight lang="cfm"> <cfset caller.addition = attributes.first + attributes.second /> <cfexit method="exitTag" /> </syntaxhighlight> Assuming the tag is in the same directory as the file (or in a pre-defined customtags directory), it can be invoked thus: <syntaxhighlight lang="cfm"> <cf_addition first="1" second="2"> </syntaxhighlight> CFX tags are custom tags which are developed using [[Java language|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 [[JavaServer Pages|JSP]] tags can also be included in CFML pages using the <cfimport> tag.{{citation needed|date=February 2017}}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)