home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / snippets / cfmodule.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  2.1 KB  |  87 lines

  1. <!--- This view-only example shows the use of CFMODULE --->
  2. <HTML>
  3. <HEAD>
  4. <TITLE>CFMODULE Example</TITLE>
  5. </HEAD>
  6.  
  7. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  8.  
  9. <BODY  bgcolor="#FFFFD5">
  10.  
  11. <BODY>
  12. <H3>CFMODULE Example</H3>
  13.  
  14. <P>
  15. This example makes use of a sample custom tag that has been saved in the file myTag.cfm in 
  16. the snippets directory. You can also save ColdFusion custom tags in the Cfusion\CustomTags 
  17. directory. For more information about using Custom Tags, please refer to 
  18. <i>Developing Web Applications</i>.
  19. </P>
  20.  
  21. <CFSET attrCollection1 = StructNew()>
  22.  
  23. <CFPARAM NAME="attrCollection1.value1" DEFAULT="22">
  24.  
  25. <CFPARAM NAME="attrCollection1.value2" DEFAULT="45">
  26.  
  27. <CFPARAM NAME="attrCollection1.value3" DEFAULT="88">
  28.  
  29. <!--- Call the tag with CFMODULE with Name--->
  30. <CFMODULE 
  31.    Template="..\snippets\myTag.cfm"
  32.     X="3"
  33.     attributeCollection=#attrCollection1# 
  34.     Y="4">
  35.  
  36. <!--- show the code --->
  37. <HR size="2" color="#0000A0">
  38. <P>Here is one way in which to invoke the custom tag, 
  39. using the TEMPLATE attribute.</P>
  40. <CFOUTPUT>#HTMLCodeFormat("    <CFMODULE
  41.     Template=""..\snippets\myTag.cfm""
  42.     X=3
  43.     attributeCollection=##attrCollection1##
  44.     Y=4>")#
  45. </CFOUTPUT>    
  46. <P>The result: <CFOUTPUT>#result#</CFOUTPUT>    
  47.  
  48. <!--- Call the tag with CFMODULE with Name--->
  49. <CFMODULE 
  50.     Name="myTag"
  51.     X="3"
  52.     attributeCollection=#attrCollection1# 
  53.     Y="4">
  54.  
  55. <!--- show the code --->
  56. <HR size="2" color="#0000A0">
  57. <P>Here is another way to invoke the custom tag, 
  58. using the NAME attribute.</P>
  59. <CFOUTPUT>#HTMLCodeFormat("    <CFMODULE
  60.     NAME='myTag'
  61.     X=3
  62.     attributeCollection=##attrCollection1##
  63.     Y=4>")#
  64. </CFOUTPUT>    
  65. <P>The result: <CFOUTPUT>#result#</CFOUTPUT>    
  66.  
  67. <!--- Call the tag using the short cut notation --->
  68. <CF_myTag 
  69.     X="3" 
  70.     attributeCollection=#attrCollection1# 
  71.     Y="4">
  72.     
  73. <!--- show the code --->    
  74. <HR size="2" color="#0000A0">
  75. <P>Here is the short cut to invoking the same tag.</P>
  76. <CFOUTPUT>#HTMLCodeFormat("    <CF_myTag 
  77.     X=3 
  78.     attributeCollection=##attrCollection1## 
  79.     Y=4>")#
  80. </CFOUTPUT>    
  81. <P>The result: <CFOUTPUT>#result#</CFOUTPUT></P>    
  82.  
  83.  
  84. </BODY>
  85. </HTML>       
  86.  
  87.