OOPhoto: Further Exploration Of The Facade And Controller-Model Interaction

<!--- This is our mock "serivice layer" method. --->
<cffunction
	name="ProcessForm"
	access="public"
	returntype="void"
	output="false"
	hint="I am a method used to mock the processing of form data.">
 
	<cfdump var="#ARGUMENTS#" />
	<cfabort />
 
	<!--- Return out. --->
	<cfreturn />
</cffunction>
 
 
<!---
	We have been getting TONS of spam submissions on this form,
	so we are going to start randomly naming the form fields to
	try and slow down the bots.
 
	As such, it is the numbering of the form fields that will
	become important, not the names.
--->
<cfset arrForm = [] />
 
<!---
	Loop over the submitted form fields to populate the form
	array values. We are relying on the fact that the FieldNames
	property of the FORM is always submitted in the same order.
 
	If this is the first run of the page, we have to param the
	field names.
--->
<cfparam name="FORM.FieldNames" type="string" default="" />
 
<!--- Loop over field names. --->
<cfloop
	index="strFieldName"
	list="#FORM.FieldNames#"
	delimiters=",">
 
	<!--- Add the next form field to our array. --->
	<cfset ArrayAppend(
		arrForm,
		FORM[ strFieldName ]
		) />
 
</cfloop>
 
 
<!--- Param form arra data. --->
<!--- From: 2. --->
<cfparam name="arrForm[ 2 ]" type="string" default="" />
<!--- To: 3. --->
<cfparam name="arrForm[ 3 ]" type="string" default="" />
<!--- Submitted: 1. --->
<cfparam name="arrForm[ 1 ]" type="boolean" default="false" />
 
 
<!--- Check to see if form was submitted. --->
<cfif arrForm[ 1 ]>
 
	<!--- Process the form data. --->
	<cfset ProcessForm( FORM ) />
 
</cfif>
 
 
<cfoutput>
 
	<!--- Reset the buffer and stream content. --->
	<cfcontent type="text/html" reset="true" />
 
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html>
	<head>
		<title>Add Crush w/ Anti-Spam</title>
	</head>
	<body>
 
		<h1>
			Add Crush w/ Anti-Spam
		</h1>
 
		<p>
			Let us know who likes who!
		</p>
 
		<form action="#CGI.script_name#" method="post">
 
			<!--- Flag form submission. --->
			<input
				type="hidden"
				name="#CreateUUID()#"
				value="true"
				/>
 
			<p>
				<!--- This person. --->
				<input
					type="text"
					name="#CreateUUID()#"
					value="#arrForm[ 2 ]#"
					/>
 
				<em>likes</em>
 
				<!--- That person. --->
				<input
					type="text"
					name="#CreateUUID()#"
					value="#arrForm[ 3 ]#"
					/>
 
				<input type="submit" value="Submit" />
			</p>
 
		</form>
 
	</body>
	</html>
 
</cfoutput>

For Cut-and-Paste