From 1f68a9645573e54354d672709605ed9975e4843b Mon Sep 17 00:00:00 2001 From: wboka Date: Fri, 9 Oct 2015 08:43:12 -0400 Subject: Update coldfusion.html.markdown Adds conversion table and example of a very basic component. Adds a link to the official Adobe ColdFusion developer reference. --- coldfusion.html.markdown | 413 +++++++++++++++++++---------------------------- 1 file changed, 163 insertions(+), 250 deletions(-) diff --git a/coldfusion.html.markdown b/coldfusion.html.markdown index 6a9b69f0..e2f0737d 100644 --- a/coldfusion.html.markdown +++ b/coldfusion.html.markdown @@ -146,263 +146,176 @@ ColdFusion is a scripting language for web development.
-``` - +

Components

+ +Code for reference (Functions must return something to support IE) + +
+<cfcomponent>
+	<cfset this.hello = "Hello" />
+	<cfset this.world = "world" />
+
+	<cffunction name="sayHello">
+		<cfreturn this.hello & ", " & this.world & "!" />
+	</cffunction>
+	
+	<cffunction name="setHello">
+		<cfargument name="newHello" type="string" required="true" />
+		
+		<cfset this.hello = arguments.newHello />
+		 
+		<cfreturn true />
+	</cffunction>
+	
+	<cffunction name="setWorld">
+		<cfargument name="newWorld" type="string" required="true" />
+		
+		<cfset this.world = arguments.newWorld />
+		 
+		<cfreturn true />
+	</cffunction>
+	
+	<cffunction name="getHello">
+		<cfreturn this.hello />
+	</cffunction>
+	
+	<cffunction name="getWorld">
+		<cfreturn this.world />
+	</cffunction>
+</cfcomponent>
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +sayHello() +

#sayHello()#

+getHello() +

#getHello()#

+getWorld() +

#getWorld()#

+setHello("Hola") +

#setHello("Hola")#

+setWorld("mundo") +

#setWorld("mundo")#

+sayHello() +

#sayHello()#

+getHello() +

#getHello()#

+getWorld() +

#getWorld()#

+``` ## Further Reading The links provided here below are just to get an understanding of the topic, feel free to Google and find specific examples. + +1. [Coldfusion Reference From Adobe](https://helpx.adobe.com/coldfusion/cfml-reference/topics.html) -- cgit v1.2.3