CFML Quick Reference
Trademarks Afterburner, AppletAce, Attain, Attain Enterprise Learning System, Attain Essentials, Attain Objects for Dreamweaver, Authorware, Authorware Attain, Authorware Interactive Studio, Authorware Star, Authorware Synergy, Backstage, Backstage Designer, Backstage Desktop Studio, Backstage Enterprise Studio, Backstage Internet Studio, ColdFusion, Design in Motion, Director, Director Multimedia Studio, Doc Around the Clock, Dreamweaver, Dreamweaver Attain, Drumbeat, Drumbeat 2000, Extreme 3D, Fireworks,
CONTENTS CFML tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 CFML functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Array functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Authentication functions . . . . . . . . . . . . . . . . . . . . . . . . . 20 Conversion functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Date and time functions . . . . . . . . . . . . . . . . . . . . . . . . . .
Standard CGI variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CFML tags cfabort cfapplet cfapplication
dataBackgroundColor = "Hex value or Web color" showBorder = "yes" or "no" font = "font name" fontSize = "integer font size" fontBold = "yes" or "no" fontItalic = "yes" or "no" labelFormat = "number, currency, percent, date" xAxisTitle = "title text" yAxisTitle = "title text" xAxisType = "scale or category" yAxisType = "scale or category" sortXAxis = "yes/no" show3D = "yes" or "no" xOffset = "number between -1 and 1" yOffset = "number between -1 and 1" rotated = "yes/no" showLegend = "yes/no" tipStyle = "Mou
cfcookie PAGE 8 PAGE 9directory = "directory name" localFile = "filename" remoteFile = "filename" item = "directory or file" existing = "file or directory name" new = "file or directory name" proxyServer = "proxy server" passive = "Yes" or "No"> cfftp action = "listDir" cffunction cfgraph See cfchart cfgraphdata See cfchartdat
cfgridcolumn
delimiter = "character" textQualifier = "character"> cfhttpparam cfif HTML and CFML tags HTML and CFML tags HTML and CFML tags cfimport cfinclude cfindex
OR cflog
username = "user name" password = "password" wraptext = "column number" charset = "character encoding" type = "msg_type" mimeattach = "path" query = "query_name" group = "query_column" groupcasesensitive = "yes" or "no" startrow = "query_row" maxrows = "max_msgs" server = "serverspecs" port = "port_id" mailerid = "headerid" timeout = "seconds" spoolenable = "yes" or "no"> cfmailparam
cfobjectcache cfoutput cfparam cfpop
or: debug > SQL statement(s) cfqueryparam AND/OR ...additional criteria of the WHERE clause...
interval = "seconds" requestTimeOut = "seconds" username = "username" password = "password" proxyServer = "hostname" proxyPort = "port_number"> proxyUser = "username" proxyPassword = "password" resolveURL = "Yes" or "No" cfscript cfscript code here cfsearch
font = "font_name" fontSize = "integer" italic = "Yes" or "No" bold = "Yes" or "No" notSupported = "text"> cfstoredproc cfswitch One or more cfcase tags Zero or one cfdefaultcase tags cftable PAGE 19cftransaction cftree
CFML functions Array functions ArrayAppend(array, value) ArrayAvg(array) ArrayClear(array) ArrayDeleteAt(array, position) ArrayInsertAt(array, position, value) ArrayIsEmpty(array) ArrayLen(array) ArrayMax(array) ArrayMin(array) ArrayNew(dimension) ArrayPrepend(array, value) ArrayResize(array, minimum_size) ArraySet(array, start_pos, end_pos, value) ArraySort(array, sort_type [, sort_order ]) ArraySum(array) ArraySwap(array, position1, position2) ArrayToList(array [, delimiter ]) IsArray(value [, number ]) L
DayOfWeekAsString(fu) DayOfYear("date") DaysInMonth("date") DaysInYear("date") FirstDayOfMonth(date) GetHttpTimeString(date_time_object) GetTickCount() GetTimeZoneInfo() Hour(date) IsDate(string) IsLeapYear(year) IsNumericDate(number) LSDateFormat(date [, mask ]) LSIsDate(string) LSParseDateTime(date/time-string) LSTimeFormat(time [, mask ]) Minute(date) Month(date) MonthAsString(month_number) Now() ParseDateTime(date/time-string [, pop-conversion ] ) Quarter(date) Second(date) TimeFormat(time [, mask ]) We
StructKeyExists(structure, "key") YesNoFormat(value) Display and formatting functions Cjustify(string, length) DateFormat("date" [, "mask" ]) DecimalFormat(number) DollarFormat(number) FormatBaseN(number, radix) GetLocale() HTMLCodeFormat(string [, version ]) HTMLEditFormat(string [, version ]) LJustify(string, length) LSCurrencyFormat(number [, type ]) LSDateFormat(date [, mask ]) LSEuroCurrencyFormat(currency-number [, type ]) LSIsCurrency(string) LSIsDate(string) LSNumberFormat(number [, mask ]) LSParse
Full-text search functions ColdFusion MX 6.1: These functions are deprecated. They might not work, and might cause errors, in a future release.
ListLast(list [, delimiters ]) ListLen(list [, delimiters ]) ListPrepend(list, value [, delimiters ]) ListQualify(list, qualifier [, delimiters ] [, elements ]) ListRest(list [, delimiters ]) ListSetAt(list, position, value [, delimiters ]) ListSort(list, sort_type [, sort_order] [, delimiters ]) ListToArray(list [, delimiters ]) ListValueCount(list, value [, delimiters ]) ListValueCountNoCase(list, value [, delimiters ]) ReplaceList(string, list1, list2) Mathematical functions Abs(number) ACos(number) Arr
GetBaseTagData(tagname [, instancenumber ] ) GetBaseTagList() GetBaseTemplatePath() GetClientVariablesList() GetTickCount() Hash(string) PreserveSingleQuotes(variable) QuotedValueList(query.column [, delimiter ]) StripCR(string) ToBase64(string or binary_object [, encoding ]) ToBinary(string_in_Base64 or binary_value) ToString(any_value [, encoding ]) URLDecode(urlEncodedString [, charset ]) URLEncodedFormat(string [, charset ]) URLSessionFormat(request_URL) ValueList(query.
LJustify(string, length) ListValueCount(list, value [, delimiters ]) ListValueCountNoCase(list, value [, delimiters ]) LSIsCurrency(string) LSIsDate(string) LSIsNumeric(string) LSParseCurrency(string) LSParseDateTime(date/time-string) LSParseEuroCurrency(currency-string) LSParseNumber(string) LTrim(string) Mid(string, start, count) MonthAsString(month_number) ParagraphFormat(string) ParseDateTime(date/time-string [, pop-conversion ] ) REFind(reg_expression, string [, start ] [, returnsubexpressions ] ) REFi
StructInsert(structure, key, value [, allowoverwrite ]) StructIsEmpty(structure) StructKeyArray(structure) StructKeyExists(structure, "key") StructKeyList(structure [, delimiter]) StructNew() StructSort(base, sortType, sortOrder, pathToSubElement) StructUpdate(structure, key, value) System functions DirectoryExists(absolute_path) ExpandPath(relative_path) FileExists(absolute_path) GetBaseTemplatePath() GetCurrentTemplatePath() GetDirectoryFromPath(path) GetEncoding(scope_name) GetException(object) GetFileF
ColdFusion variables ColdFusion MX returns variables, such as those returned in a cfdirectory or cfftp operation. A variable is usually referenced by scoping it according to its type: naming it according to the code context in which it is available; for example, Session.varname, or Application.varname. You use the cflock tag to limit the scope of CFML constructs that modify shared data structures, files, and CFXs, to ensure that modifications occur sequentially.
Custom tag variables A ColdFusion custom tag returns the following variables: ThisTag.ExecutionMode ThisTag.HasEndTag ThisTag.GeneratedContent ThisTag.AssocAttribs[index] A custom tag can set a Caller variable to provide information to the caller. The Caller variable is set as follows: The calling page can access the variable with the cfoutput tag, as follows: #Caller.
queryname.CurrentRow queryname.RecordCount queryname.ColumnList CFCATCH variables Within a cfcatch block, the active exception properties can be accessed as the following variables: CFCATCH.Type CFCATCH.Message CFCATCH.Detail CFCATCH.ErrNumber CFCATCH.NativeErrorCode CFCATCH.SQLState CFCATCH.LockName CFCATCH.LockOperation CFCATCH.MissingFileName CFCATCH.TagContext CFCATCH.ErrorCode CFCATCH.
Note: You can substitute the prefix CFERROR for Error, if type = "Exception" or "Monitor"; for example, CFERROR.Diagnostics, CFERROR.Mailto or CFERROR.DateTime. CFFILE ACTION=Upload variables File variables are read-only. Use the CFFILE prefix to reference file variables; for example, CFFILE.ClientDirectory. The File prefix is deprecated in favor of the CFFILE prefix. CFFILE.AttemptedServerFile CFFILE.ClientDirectory CFFILE.ClientFile CFFILE.ClientFileExt CFFILE.ClientFileName CFFILE.ContentSubType CFFILE.
CFHTTP variables A cfhttp get operation can return text and binary files. Files are downloaded and the contents stored in a variable or file, depending on the MIME type, as follows: CFHTTP.FileContent CFHTTP.MimeType CFHTTP.Header CFHTTP.ResponseHeader[http_hd_key] CFHTTP.StatusCode CFLDAP variables The cfldap action=query tag returns information about the LDAP query, as follows: queryname.CurrentRow queryname.RecordCount queryname.
searchname.Title searchname.Score searchname.Custom1 and Custom2 searchname.Summary searchname.RecordCount searchname.CurrentRow searchname.RecordsSearched searchname.ColumnList Standard CGI variables This section lists the CGI 1.1 variables that some web servers create when a CGI script is called. The CGI variables that are available for your use vary with the web server and configuration. Some of the following variables may not be available. Request CGI.AUTH_TYPE CGI.CONTENT_LENGTH CGI.CONTENT_TYPE CGI.
CFML Quick Reference