home *** CD-ROM | disk | FTP | other *** search
- <!--- This view-only example shows the use of CFMODULE --->
- <HTML>
- <HEAD>
- <TITLE>CFMODULE Example</TITLE>
- </HEAD>
-
- <BASEFONT FACE="Arial, Helvetica" SIZE=2>
-
- <BODY bgcolor="#FFFFD5">
-
- <BODY>
- <H3>CFMODULE Example</H3>
-
- <P>
- This example makes use of a sample custom tag that has been saved in the file myTag.cfm in
- the snippets directory. You can also save ColdFusion custom tags in the Cfusion\CustomTags
- directory. For more information about using Custom Tags, please refer to
- <i>Developing Web Applications</i>.
- </P>
-
- <CFSET attrCollection1 = StructNew()>
-
- <CFPARAM NAME="attrCollection1.value1" DEFAULT="22">
-
- <CFPARAM NAME="attrCollection1.value2" DEFAULT="45">
-
- <CFPARAM NAME="attrCollection1.value3" DEFAULT="88">
-
- <!--- Call the tag with CFMODULE with Name--->
- <CFMODULE
- Template="..\snippets\myTag.cfm"
- X="3"
- attributeCollection=#attrCollection1#
- Y="4">
-
- <!--- show the code --->
- <HR size="2" color="#0000A0">
- <P>Here is one way in which to invoke the custom tag,
- using the TEMPLATE attribute.</P>
- <CFOUTPUT>#HTMLCodeFormat(" <CFMODULE
- Template=""..\snippets\myTag.cfm""
- X=3
- attributeCollection=##attrCollection1##
- Y=4>")#
- </CFOUTPUT>
- <P>The result: <CFOUTPUT>#result#</CFOUTPUT>
-
- <!--- Call the tag with CFMODULE with Name--->
- <CFMODULE
- Name="myTag"
- X="3"
- attributeCollection=#attrCollection1#
- Y="4">
-
- <!--- show the code --->
- <HR size="2" color="#0000A0">
- <P>Here is another way to invoke the custom tag,
- using the NAME attribute.</P>
- <CFOUTPUT>#HTMLCodeFormat(" <CFMODULE
- NAME='myTag'
- X=3
- attributeCollection=##attrCollection1##
- Y=4>")#
- </CFOUTPUT>
- <P>The result: <CFOUTPUT>#result#</CFOUTPUT>
-
- <!--- Call the tag using the short cut notation --->
- <CF_myTag
- X="3"
- attributeCollection=#attrCollection1#
- Y="4">
-
- <!--- show the code --->
- <HR size="2" color="#0000A0">
- <P>Here is the short cut to invoking the same tag.</P>
- <CFOUTPUT>#HTMLCodeFormat(" <CF_myTag
- X=3
- attributeCollection=##attrCollection1##
- Y=4>")#
- </CFOUTPUT>
- <P>The result: <CFOUTPUT>#result#</CFOUTPUT></P>
-
-
- </BODY>
- </HTML>
-
-