My favorites | Sign in
Project Logo
                
Search
for

NOTE: This wiki contains "bleeding edge" documentation, which may reflect a future version of Wheels. Entries in the wiki may also be incomplete and unedited. Please visit cfwheels.org/docs for the "official" documentation.

Introduction

Handling Requests With Controllers

Database Interaction Through Models

Displaying Views to Users

Working With Wheels

Contributing to Wheels

Sample Applications

The Wheels API

* Not scheduled for the 1.0 release.

Updated Jun 01, 2009 by rieraraul
Labels: chapter, draft
CFMLandMVCBestPractices  
Wheels and all of the tools included in CFML engines offer quite a useful toolset. Here's how to best combine the 2 together.

ColdFusion on Wheels mixes the best of both worlds: increased productivity characteristic of the Ruby on Rails framework along with the best-in-class tool set provided through built-in CFML scopes, tags, and functions.

Much of this chapter is a reference for which layer of the MVC pattern is most appropriate for each scope, tag, or function. Here's how you can take advantage of CFML elements while still honoring Wheels MVC best practices.

And hey, this reference may even be useful for you if you develop applications using other CFML controller/MVC frameworks like Fusebox, Mach-II, Model-Glue, and others.

CFML Scopes

Scope Docs Model View Controller Notes
application
arguments
attributes
caller
cgi
client
cookie
flash
form
request
server
session
this
thisTag
thread
url
variables

CFML Tags

Tag Docs Model View Controller Notes
cfabort CF8 Railo 3.1 Controller
cfadmin Railo 3.1
cfajaximport CF8 Railo 3.1 View
cfajaxproxy CF8 Railo 3.1 View
cfapplet CF8 Railo 3.1 View
cfapplication CF8 Railo 3.1
cfargument CF8 Railo 3.1 Model Controller
cfassociate CF8 Railo 3.1
cfauthenticate Railo 3.1 Controller
cfbreak CF8 Railo 3.1 Model View Controller
cfcache CF8 Railo 3.1 Controller
cfcalendar CF8 Railo 3.1 View
cfcase CF8 Railo 3.1 Model View Controller
cfcatch CF8 Railo 3.1 Model View Controller
cfchart CF8 Railo 3.1 View
cfchartdata CF8 Railo 3.1 View
cfchartseries CF8 Railo 3.1 View
cfcol CF8 Railo 3.1 View
cfcollection CF8 Railo 3.1 Controller
cfcomponent CF8 Railo 3.1 Model Controller
cfcontent CF8 Railo 3.1 View
cfcontinue Railo 3.1 Model View Controller
cfcookie CF8 Railo 3.1 Controller
cfdbinfo CF8 Railo 3.1 Model
cfdefaultcase
cfdiv
cfdocument
cfdocumentitem
cfdocumentsection
cfdump
cfelse
cfelseif
cferror
cfexchangecalendar
cfexchangeconnection
cfexchangecontact
cfexchangefilter
cfexchangemail
cfexchangetask
cfexecute
cfexit
cffeed
cffile
cfflush
cfform
cfformgroup
cfformitem
cfftp
cffunction
cfgrid
cfgridcolumn
cfgridrow
cfgridupdate
cfheader
cfhtmlhead
cfhttp
cfhttpparam
cfif
cfimage
cfimport
cfinclude
cfindex
cfinput
cfinsert
cfinterface
cfinvoke
cfinvokeargument
cflayout
cflayoutarea
cfldap
cflocation
cflock
cflog
cflogin
cfloginuser
cflogout
cfloop
cfmail
cfmailparam
cfmailpart
cfmenu
cfmenuitem
cfmodule
cfntauthenticate
cfobject
cfobjectcache
cfoutput
cfparam
cfpdf
cfpdfform
cfpdfformparam
cfpdfparam
cfpdfsubform
cfpod
cfpop
cfpresentation
cfpresentationslide
cfpresenter
cfprint
cfprocessingdirective
cfprocparam
cfprocresult
cfproperty
cfquery
cfqueryparam
cfregistry
cfreport
cfreportparam
cfrethrow
cfreturn
cfsavecontent
cfschedule
cfscript
cfsearch
cfselect
cfset
cfsetting
cfsilent
cfslider
cfsprydataset
cfstoredproc
cfswitch
cftable
cftextarea
cfthread
cfthrow
cftimer
cftooltip
cftrace
cftransaction
cftree
cftreeitem
cftry
cfupdate
cfwddx
cfwindow
cfxml
cfzip
cfzipparam

CFML Functions

Function Docs Model View Controller Notes
Abs
ACos
AddSoapRequestHeader
AddSoapResponseHeader
AjaxLink
AjaxOnLoad
ArrayAppend
ArrayAvg
ArrayClear
ArrayDeleteAt
ArrayInsertAt
ArrayIsDefined
ArrayIsEmpty
ArrayLen
ArrayMax
ArrayMin
ArraySet
ArraySort
ArrayNew
ArrayPrepend
ArrayResize
ArraySum
ArraySwap
ArrayToList
Asc
ASin
Atn
BinaryDecode
BinaryEncode
BitAnd
BitMaskClear
BitMaskRead
BitMaskSet
BitNot
BitOr
BitShln
BitShrn
BitXor
Ceiling
CharsetDecode
CharsetEncode
Chr
CJustify
Compare
CompareNoCase
Cos
CreateDate
CreateDateTime
CreateObject
CreateOdbcDate
CreateOdbcDateTime
CreateOdbcTime
CreateTime
CreateTimeSpan
CreateUuid
DateAdd
DateCompare
DateConvert
DateDiff
DateFormat
DatePart
Day
DayOfWeek
DayOfWeekAsString
DayOfYear
DaysInMonth
DaysInYear
De
DecimalFormat
DecrementValue
Decrypt
DecryptBinary
DeleteClientVariable
DeserializeJson
DirectoryExists
DollarFormat
DotNetToCfType
Duplicate
Encrypt
EncryptBinary
Evaluate
Exp
ExpandPath
FileClose
FileCopy
FileDelete
FileExists
FileIsEof
FileMove
FileOpen
FileRead
FileReadBinary
FileReadLine
FileSetAccessMode
FileSetAttribute
FileSetLastModified
FileWrite
Find
FindNoCase
FindOneOf
FirstDayOfMonth
Fix
!FormatBaseN
GenerateSecretKey
GetAuthUser
GetBaseTagData
GetBaseTagList
GetBaseTemplatePath
GetClientVariablesList
GetComponentMetaData
GetContextRoot
GetCurrentTemplatePath
GetDirectoryFromPath
GetEncoding
GetException
GetFileFromPath
GetFileInfo
GetFunctionList
GetGatewayHelper
GetHttpRequestData
GetHttpTimeString
GetK2ServerDocCount
GetK2ServerDocCountLimit
GetLocale
GetLocaleDisplayName
GetLocalHostIp
GetMetaData
GetMetricData
GetPageContext
GetPrinterInfo
GetProfileSections
GetProfileString
GetReadableImageFormats
GetSoapRequest
GetSoapRequestHeader
GetSoapResponse
GetSoapResponseHeader
GetTempDirectory
GetTempFile
GetTemplatePath
GetTickCount
GetTimeZoneInfo
GetToken
GetUserRoles
GetWriteableImageFormats
Hash
Hour
HtmlCodeFormat
HtmlEditFormat
Iif
ImageAddBorder
ImageBlur
ImageClearRect
ImageCopy
ImageCrop
ImageDrawArc
ImageDrawBeveledRect
ImageDrawCubicCurve
ImageDrawLine
ImageDrawLines
ImageDrawOval
ImageDrawPoint
ImageDrawQuadraticCurve
ImageDrawRect
ImageDrawRoundRect
ImageDrawText
ImageFlip
ImageGetBlob
ImageGetBufferedImage
ImageGetExifTag
ImageGetHeight
ImageGetIptcTag
ImageGetWidth
ImageGrayscale
ImageInfo
ImageNegative
ImageNew
ImageOverlay
ImagePaste
ImageRead
ImageReadBase64
ImageResize
ImageRotate
ImageRotateDrawingAxis
ImageScaleToFit
ImageSetAntialiasing
ImageSetBackgroundColor
ImageSetDrawingColor
ImageSetDrawingStroke
ImageSetDrawingTransparency
ImageSharpen
ImageShear
ImageShearDrawingAxis
ImageTranslate
ImageTranslateDrawingAxis
ImageWrite
ImageWriteBase64
ImageXorDrawingMode
IncrementValue
!InputBaseN
Insert
Int
IsArray
IsBinary
IsBoolean
IsCustomFunction
IsDate
IsDdx
IsDebugMode
IsDefined
IsImage
IsImageFile
IsInstanceOf
IsJson
IsLeapYear
IsLocalHost
IsNumeric
IsNumericDate
IsObject
IsPdfFile
IsPdfObject
IsQuery
IsSimpleValue
IsSoapRequest
IsStruct
IsUserInAnyRole
IsUserInRole
IsUserLoggedIn
IsValid
IsWddx
IsXml
IsXmlAttribute
IsXmlDoc
IsXmlElem
IsXmlNode
IsXmlRoot
JavaCast
!JSStringFormat
LCase
Left
Len
ListAppend
ListChangeDelims
ListContains
ListContainsNoCase
ListDeleteAt
ListFind
ListFindNoCase
ListFirst
ListGetAt
ListInsertAt
ListLast
ListLen
ListPrepend
ListQualify
ListRest
ListSetAt
ListSort
ListToArray
ListValueCount
ListValueCountNoCase
LJustify
Log
Log10
LsCurrencyFormat
LsDateFormat
LsEuroCurrencyFormat
LsIsCurrency
LsIsDate
LsIsNumeric
LsNumberFormat
LsParseCurrency
LsParseDateTime
LsParseEuroCurrency
LsParseNumber
LsTimeFormat
LTrim
Max
Mid
Min
Minute
Month
MonthAsString
Now
NumberFormat
ParagraphFormat
ParseDateTime
Pi
PrecisionEvaluate
PreserveSingleQuotes
Quarter
QueryAddColumn
QueryAddRow
QueryConvertForGrid
QueryNew
QuerySetCell
QuotedValueList
Rand
Randomize
RandRange
ReFind
ReFindNoCase
ReleaseComObject
ReMatch
ReMatchNoCase
RemoveChars
RepeatString
Replace
ReplaceList
ReplaceNoCase
ReReplace
ReReplaceNoCase
Reverse
Right
RJustify
Round
RTrim
Second
SendGatewayMessage
SerializeJson
SetEncoding
SetLocale
SetProfileString
SetVariable
Sgn
Sin
Sleep
SpanExcluding
SpanIncluding
Sqr
StripCr
StructAppend
StructClear
StructCopy
StructCount
StructDelete
StructFind
StructFindKey
StructFindValue
StructGet
StructInsert
StructIsEmpty
StructKeyArray
StructKeyExists
StructKeyList
StructNew
StructSort
StructUpdate
Tan
TimeFormat
ToBase64
ToBinary
ToScript
ToString
Trim
UCase
UrlDecode
UrlEncodedFormat
UrlSessionFormat
Val
ValueList
VerifyClient
Week
Wrap
WriteOutput
XmlChildPos
XmlElemNew
XmlFormat
XmlGetNodeType
XmlNew
XmlParse
XmlSearch CF8 Railo 3.1 Model
XmlTransform CF8 Railo 3.1 Model
XmlValidate CF8 Railo 3.1 Model
Year CF8 Railo 3.1 View
YesNoFormat CF8 Railo 3.1 View

Agree to Disagree

There are times that it is appropriate to break these best practices, but we've tried to present as pure of a MVC-based opinion as possible. Be sure to leave a comment below if you disagree with anything or if you have any specific CFML usage questions.


Comment by rieraraul, Jun 01, 2009

Wow!

Comment by rieraraul, Jun 01, 2009

How about if I go from the bottom-up and you up-bottom? It's a MASSIVE chapter you are trying to do here

Comment by per.djurner, Jun 01, 2009

Wow, cool!

Comment by ch...@clearcrystalmedia.com, Jun 01, 2009

Thanks guys. While a lot of work, I think that this is something that can be valuable to the entire CF community, regardless of which framework they're using. It's also kind of cool to see what's in CF8 vs. Railo 3.1.

I'm definitely going to need your opinions on some of this though. I've already run across a couple situations where I wasn't sure exactly what to put.

Raul, feel free to help out by starting at the bottom like you suggested. You're right... it is quite a massive task!

Comment by rieraraul, Jun 01, 2009

I wish CF8 links were as easy as Railo, maybe using http://www.cfquickdocs.com paths would be a lot easier and we could even auto generate this documentation

http://www.cfquickdocs.com/cf8/#XmlSearch (CF8 example) http://wiki.getrailo.org/wiki/3-1-Functions: XmlSearch? (Railo example)


Sign in to add a comment
Hosted by Google Code