
19
DEVELOPING
COLDFUSION 9 APPLICATIONS
The CFML Programming Language
Las
t
upda
te
d 8/5/2010
<!--- Configure dynamic attribute variables. --->
<cfparam name="theURL" default="http://www.adobe.com">
<cfparam name="resolveURL" default="yes">
<!--- Code that dynamically changes values for attributes can go here. --->
<!--- Create an arguments structure using variables. --->
<cfset myArgs=StructNew()>
<cfset myArgs.url="#theURL#">
<!--- Include a user name and password only if they are available. --->
<cfif IsDefined("username")>
<cfset myArgs.username="#username#">
</cfif>
<cfif IsDefined("password")>
<cfset myArgs.password="#password#">
</cfif>
<cfset myArgs.resolveURL="#resolveURL#">
<cfset myArgs.timeout="2">
<!--- Use the myArgs structure to specify the cfhttp tag attributes. --->
<cfhttp attributeCollection="#myArgs#">
<cfoutput>
#cfhttp.fileContent#
</cfoutput>
Note:
The
attributeCollection
attribute used in the
cfmodule
tag and when calling custom tags directly is different
from the
attributeCollection
attribute for all other tags. In the
cfmodule
tag and in custom tags, you can mix the
attributeCollection
attribute and explicit custom tag attributes. Also, in the
cfmodule
tag, the
attributeCollection
attribute cannot contain the
name
and
template
attributes. Specify these attributes directly in
the
cfmodule
tag.
You can use the
attributeCollection
attribute in all tags
except
the following:
Built-in tags
Built-in tags make up the heart of ColdFusion. These tags have many uses, including the following:
•
Manipulating variables
•
Creating interactive forms
•
Accessing and manipulating databases
•
Displaying data
•
Controlling the flow of execution on the ColdFusion page
•
Handling errors
cfargument
cfelseif
cflogout
cfset
cfbreak
cffunction
cfloop
cfsilent
cfcase
cfif
cfparam
cfswitch
cfcatch
cfimport
cfprocessingdirective
cftry
cfcomponent
cfinterface
cfproperty
cfdefaultcase
cflogin
cfrethrow
cfelse
cfloginuser
cfreturn
Содержание COLDFUSION 9
Страница 1: ...Developing Applications ADOBE COLDFUSION 9...