Whatever message this page gives is out now! Go check it out!
<cf_getmd Name=#NameYouEntered#><cf_mytag Firstname="Thadeus" Lastname="Jones"><cfset Caller.Doctor="Doctor " & Attributes.Name>
<cf_mytag resultName="returnHere"><cfset "Caller.#Attributes.resultName#" = result>the calling page does not set it, make it "Who". --->
<cfparam name="Attributes.Name" default="Who"><cfabort showError="The Name attribute is required.">
</cfif><head>
<title>Enter Name</title>
</head>
<body>
<!--- Enter a name, which could also be done in a form. --->
<!--- This example simply uses a cfset. --->
<cfset NameYouEntered="Smith">
<!--- Display the current name. --->
<cfoutput>
Before you leave this page, you're #Variables.NameYouEntered#.<br>
</cfoutput>
<!--- Go to the custom tag. --->
<cf_getmd Name="#NameYouEntered#">
<!--- Come back from the Custom tag --->
<!--- Display the results of the custom tag. --->
<cfoutput>
You are now #Variables.Doctor#.<br>
</cfoutput>
</body>
</html>If the calling page does not set it, make it "Who". --->
<cfparam name="Attributes.Name" default="Who">
<!--- Create a variable called Doctor, make its value "Doctor "
followed by the value of the variable Attributes.Name.
Make its scope Caller so it is passed back to the calling page.
--->
<cfset Caller.Doctor="Doctor " & Attributes.Name>| Code | Description |
<cfset NameYouEntered="Smith"> | In the calling page, create a variable NameYouEntered and assign it the value Smith. |
Before you leave this page, you're #Variables.NameYouEntered#.<br> </cfoutput> | In the calling page, display the value of the NameYouEntered variable before calling the custom tag. |
<cf_getmd Name="#NameYouEntered#"> | In the calling page, call the getmd custom tag and pass it the Name attribute whose value is the value of the local variable NameYouEntered. |
<cfparam name="Attributes.Name" default="Who"> | The custom tag page normally gets the Name variable in the Attributes scope from the calling page. Assign it the value Who if the calling page did not pass an attribute. |
<cfset Caller.Doctor="Doctor " & Attributes.Name> | In the custom tag page, create a variable called Doctor in the Caller scope so it exists in the calling page as a local variable.Set its value to the concatenation of the string "Doctor" and the value of the {{Attributes.Name }}variable. |
You are now #Variables.Doctor#.<br> </cfoutput> | In the calling page, display the value of the Doctor variable returned by the custom tag page. (This example uses the Variables scope prefix to emphasize the fact that the variable is returned as a local variable.) |
<cfset zort.x = "-X-">
<cfset zort.y = "-Y-">
<cf_testtwo a="blab" attributeCollection=#zort# foo="16"><cfoutput>#attributes.a# #attributes.x# #attributes.y#
#attributes.foo#</cfoutput><br>
--- end custom tag ---blab -X- -Y- 16
--- end custom tag ---<cf_first attr1="foo" attr2="bar"><cf_second attributeCollection="#attributes#"><cfoutput>#attributes.attr1#</cfoutput>
<cfoutput>#attributes.attr2#</cfoutput>