This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfsetting showdebugoutput="false"> | |
Data Example | |
<cfdump var="#form#"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfcomponent displayname="CFArtGallery" output="true" hint="Handle the application."> | |
<!--- Set up the application. ---> | |
<cfset THIS.Name = "CFArtGallery" /> | |
<cfset THIS.ApplicationTimeout = CreateTimeSpan( 0, 0, 1, 0 ) /> | |
<cfset THIS.SessionManagement = true /> | |
<cfset THIS.SetClientCookies = false /> | |
<cfset this.datasource = "cfartgallery" /> | |
<cfset this.ormEnabled = true /> | |
<cfset this.ormSettings = { logsql : true } /> | |
<cfset this.invokeImplicitAccessor = true /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @accessors true | |
* @output "no" | |
*/ | |
component displayname="Artist" hint="Artist" | |
{ | |
property name="artistid" type="numeric" displayname="ArtistID" hint="ArtistID"; | |
property name="firstname" type="string" displayname="First Name" hint="First Name"; | |
property name="lastname" type="string" displayname="Last Name" hint="Last Name"; | |
property name="address" type="string" displayname="Address" hint="Address"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<CFSCRIPT> | |
myQry = new Query(datasource="cfartgallery"); // new query object | |
myQry.setSQL("select bookid, title, genre from app.books where bookid = :bookid"); //set query | |
myQry.addParam(name="bookid",value="5",CFSQLTYPE="CF_SQL_INT"); // add query param | |
qryRes = myQry.execute(); // execute query | |
writedump(qryRes.getResult().recordcount, true); // get resultcount | |
writedump(qryRes.getResult(), false); // dump result | |
writeoutput('<BR>'); | |
</CFSCRIPT> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- All methods in this helper will be available in all handlers,plugins,views & layouts ---> | |
<cfscript> | |
// Alternating Row (classes, bgcolor, or any other alternating row useage) | |
// example: alternatingRow(TheCurrentRowCount,EvenRowText,OddRowText) | |
function alternatingRow(currentRow,evenRow,oddRow) { | |
var returnVar = IIF(currentRow Mod 2, DE(evenrow), DE(oddrow)); | |
return returnVar; | |
} | |
</cfscript> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<title>ColdFusion Art Gallery</title> | |
</head> | |
<body> | |
<!--- Render The View. This is set wherever you want to render the view in your Layout. ---> | |
<cfoutput>#renderView()#</cfoutput> | |
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfcomponent output="false" hint="My App Configuration"> | |
<cfscript> | |
/** | |
structures/arrays to create for configuration | |
- coldbox (struct) | |
- settings (struct) | |
- conventions (struct) | |
- environments (struct) | |
- ioc (struct) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<base href="#getSetting('htmlbaseURL')#"/> | |
<link href="#getSetting('htmlbaseURL')#includes/styles/default.css" rel="stylesheet"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getSelectedText(){ | |
var e = document.getElementById("nameSelect"); | |
var dspText = e.options[e.selectedIndex].text; | |
return dspText; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cffunction name="querytoarray" returntype="array" output="No"> | |
<cfargument name="q" required="Yes" type="query"> | |
<cfset var aTmp = arraynew(1)> | |
<cfif q.recordcount> | |
<cfloop query="q"> | |
<cfset stTmp = structNew()> | |
<cfloop list="#lcase(q.columnlist)#" index="col"> | |
<cfset stTmp[col] = q[col][currentRow]> | |
</cfloop> |