Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 219

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Building Blocks of ColdFusion Applications
<html>
<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>
Save the page as
2
callingpage.cfm
3
Create another page (the custom tag) with the following content:
<!--- The value of the variable Attributes.Name comes from the calling page.
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>
4
Save the page as
getmd.cfm
Open the file
5
callingpage.cfm
The calling page uses the
getmd
Reviewing the code
The following table describes the code and its function:
.
.
in your browser.
custom tag and displays the results.
Last updated 1/20/2012
214

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents