COLDFUSION MARKUP LANGUAGE
'ColdFusion Markup Language', more commonly known as 'CFML', is the scripting language used by Adobe ColdFusion, New Atlanta's BlueDragon and several alternative server environments such as Coral Web Builder, IgniteFusion, Railo. It is similar to HTML in that it uses tags, need not be well-formed, and includes a built-in script tag to allow inline scripting within markup.
Tags which are included in the core runtime are always prefixed with a ''cf'' followed by unique identified, starting with a letter. Custom tags written in CFML may be prefixed with ''cf_'', although there are other ways to invoke them.
Procedural style functions are available throughout a CFScript.
CFML is generally considered a dynamic language. However, various tags offer the ability to type-check input parameters (eg: cffunction, cfparam, cfqueryparam) if the programmer declares their type specifically. It is debated whether this is good practice, as failure occurs at runtime regardless of whether type checking is used or not.
CFML is case insensitive.
CFML relies heavily on maps, where the keys are always strings and the values are not type specific. Values are often accessed using dot notation, but -- depending on the CFML implementation -- can be accessed via procedural functions, or can be treated as objects where instance ''get'' methods are invoked.
Recent CFML implementations include support for objects, known as components. Component definitions reside in a file, and are surrounded by ''cfcomponent'' tags.
Message passing to components is also done via dot notation, similar to other object-oriented languages such as Java. If omitting the open and close brackets of a method invocation, ColdFusion will treat the function as the value object a map. This allows methods to be treated as first-class objects.
CFML need not be well-formed. If it is legal for tags not to have a body, it is syntactically acceptable to leave them unclosed. For example:
The self-closing variant
is also legal. Which style should be used is an often debated issue.
CFML allows language extensions in the form of custom tags. Custom tags are normal 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.
If a template is invoked as a custom tag, the attributes used to invoke that tag are available in a special structure ''attributes'' and the variables on the calling page are accessible via the ''caller'' struct. For example, if writing an ''add'' tag which takes two attributes and adds them together, the add.cfm page would look like this:
The tag can be invoked thusly:
assuming the template and tag are in the same directory.
★ BlueDragon
★ Railo
★ ColdFusion
★ Smith
★ Ignite Fusion
★ Coral
★ [link Camuffo]
| Contents |
| Syntax |
| Custom Tags |
| See also (CFML Servers) |
Syntax
Tags which are included in the core runtime are always prefixed with a ''cf'' followed by unique identified, starting with a letter. Custom tags written in CFML may be prefixed with ''cf_'', although there are other ways to invoke them.
Procedural style functions are available throughout a CFScript.
CFML is generally considered a dynamic language. However, various tags offer the ability to type-check input parameters (eg: cffunction, cfparam, cfqueryparam) if the programmer declares their type specifically. It is debated whether this is good practice, as failure occurs at runtime regardless of whether type checking is used or not.
CFML is case insensitive.
CFML relies heavily on maps, where the keys are always strings and the values are not type specific. Values are often accessed using dot notation, but -- depending on the CFML implementation -- can be accessed via procedural functions, or can be treated as objects where instance ''get'' methods are invoked.
Recent CFML implementations include support for objects, known as components. Component definitions reside in a file, and are surrounded by ''cfcomponent'' tags.
Message passing to components is also done via dot notation, similar to other object-oriented languages such as Java. If omitting the open and close brackets of a method invocation, ColdFusion will treat the function as the value object a map. This allows methods to be treated as first-class objects.
CFML need not be well-formed. If it is legal for tags not to have a body, it is syntactically acceptable to leave them unclosed. For example:
The self-closing variant
is also legal. Which style should be used is an often debated issue.
Custom Tags
CFML allows language extensions in the form of custom tags. Custom tags are normal 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.
If a template is invoked as a custom tag, the attributes used to invoke that tag are available in a special structure ''attributes'' and the variables on the calling page are accessible via the ''caller'' struct. For example, if writing an ''add'' tag which takes two attributes and adds them together, the add.cfm page would look like this:
The tag can be invoked thusly:
assuming the template and tag are in the same directory.
See also (CFML Servers)
★ BlueDragon
★ Railo
★ ColdFusion
★ Smith
★ Ignite Fusion
★ Coral
★ [link Camuffo]
This article provided by Wikipedia. To edit the contents of this article, click here for original source.
psst.. try this: add to faves

العربية
中国
Français
Deutsch
Ελληνική
हिन्दी
Italiano
日本語
Português
Русский
Español