Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 215

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Building Blocks of ColdFusion Applications
• The cfusion\CustomTags directory
• A subdirectory of the cfusion\CustomTags directory
• A directory that you specify in the ColdFusion Administrator
To share a custom tag among applications in multiple directories, place it in the cfusion\CustomTags directory. You
can create subdirectories to organize custom tags. ColdFusion searches recursively for the Custom Tags directory,
stepping down through any existing subdirectories until the custom tag is found.
You can have a situation where you have multiple custom tags with the same name. To guarantee which tag
ColdFusion calls, copy it to the same directory as the calling page. Or, use the
attribute to specify the absolute path to the custom tag. For more information on
Calling custom tags with the cfmodule tag
You can also use the
cfmessagebox
The
tag is useful if you are concerned about possible name conflicts when using a custom tag, or if the
cfmodule
application must use a variable to dynamically call a custom tag at runtime.
Use either a
or
template
name
attributes:
cfmodule
Attribute
Description
template
Required if the
Specifies a path relative to the directory of the calling page.
If the path value is prefixed with "/", ColdFusion searches directories explicitly mapped in the ColdFusion
Administrator for the included file.
Example:
Required if the
name
under the CustomTags root directory.
Example:
CustomTags\MyApp directory under the ColdFusion root directory.
The custom tag's attributes.
attributes
For example, the following code specifies to execute the custom tag defined by the mytag.cfm page in the parent
directory of the calling page:
<cfmodule template="../mytag.cfm">
For more information on using the
Calling custom tags with the cfimport tag
You can use the
tag to import custom tags from a directory as a tag library. The following example imports
cfimport
the tags from the directory myCustomTags:
<cfimport prefix="mytags" taglib="myCustomTags">
Once imported, you call the custom tags using the prefix that you set when importing, as the following example shows:
<mytags:customTagName>
where customTagName corresponds to a ColdFusion application page named customTagName.cfm. If the tag takes
attributes, you include them in the call:
<mytags:custom_tag_name attribute1=val_1 attribute2=val_2>
tag to call custom tags if you want to specify the location of the custom tag page.
attribute in the tag, but you cannot use both. The following table describes the basic
name
attribute is not used. Same as the
<cfmodule template="../MyTag.cfm">
attribute is not used. Use period-separated names to uniquely identify a subdirectory
template
<cfmodule name="MyApp.GetUserOptions">
tag, see the CFML Reference.
cfmessagebox
Last updated 1/20/2012
tag with the
cfmodule
, see the next section.
cfmodule
template
attribute in cfinclude. This attribute:
identifies a custom tag file in the parent directory.
identifies the file GetUserOptions.cfm in the
210
template

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents