Type and CFCs

Two tags related to CFCs (and tag based UDFs) let you specify a type value: cffunction and cfarguments. The type values can be one from this list:

any
array
boolean
date
GUID
numeric
query
string
struct
UUID
variableName

However - what happens if you pass something else? If CFMX encounters any other value, it assumes you are using the name of a CFC. For example, if you said type=”person”, it would assume a value of type person.

This often confuses people. For example, I’ve seen people use “integer” for type, assuming the CFC will expect a number, but instead it will expect an instance of the integer cfc. So - if you forget what the valid types are, just check your docs, or your right-click-edit vtm in HomeSite+.

Raymond Camden's Picture

About Raymond Camden

Raymond is a developer advocate looking for his next gig. He focuses on JavaScript, serverless and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support.

Lafayette, LA https://www.raymondcamden.com

Comments