Top 10 Underrated Functions in ColdFusion
I gave a presentation at my local CFUG yesterday called 10 Underrated Functions in ColdFusion, I plan on doing one for tags as well at some point. Here was my list of functions, in no particular order:
- ValueList - Returns the contents of an entire query column in a string list.
- ExpandPath - Returns a server file path relative to the calling template.
- Hash - Encodes a string using MD5, or in CFMX 7 you can specify any hashing algorithm such as SHA.
- RandRange - Returns a random number bound by two integers.
- XmlFormat - Escapes special characters in XML, and can also be used to prevent cross site scripting attacks.
- IsValid - Validates that a string is in the specified format (email, ssn, integer, etc).
- GetMetricData - Gives server metrics, like average request time, etc.
- ToScript - Serializes a ColdFusion variable into JavaScript or ActionScript
- GetPageContext - Gets the JSP PageContext object. Can be used to include JSP files in a CFM page, and more.
- XmlSearch - Search an XML document using an XPath Query
Did I have any obvious omissions? What would be on your list?
Tweet
add to del.icio.us
| Tags: functions, cfml, coldfusion, valuelist, expandpath, hash, randrange, xmlformat, isvalid, getmetricdata, toscript, getpagecontext, xmlsearch, xpath, cfug
Related Entries
- Parsing RSS 1.0 with ColdFusion MX - April 9, 2004
- RSS and XPath - April 8, 2004
- Getting the Application Root Path in ColdFusion - April 9, 2007
- Announcing CFML Weekly Email - October 19, 2012
- HashDOS and ColdFusion - December 31, 2011
Trackbacks
Comments
incrementValue/decrementValue: If you don't need to keep the result, this is handy in urls, for example, linking ot the next page.
isDebugMode - add your own debug stuff (I need to blog this)
A big amen on isValid. I think it is probably the least known cool feature of CF7.
I'm even more amazed that I still do it from time to time =)
monthAsString(month(now())) would do the trick.. also for days. Much overlooked function. LSDateFormat(now(),'mmmm') would also do it.
I'd love to see an example of where XmlFormat doesn't work. I haven't had any problems with it, not to say there aren't - I'd just like to see first hand.
I had to use the udfs above xmlFormat2(xmlsafe()), lazy I know but it works.
Post a Comment
Recent Entries
- Writing Secure CFML cfObjective 2013 Slides
- Upgrading to Java 7 on Linux
- J2EE Sessions in CF10 Uses Secure Cookies
- Learn about ColdFusion Security at cfObjective 2013
- Session Loss and Session Fixation in ColdFusion
- FuseGuard 2.3 Released
- CKEditor Spell Checker Plugin
- Adobe Says Go Ahead and Upgrade your ColdFusion JVM





