Defines a function that you can call in CFML. Required to
defined CFML component methods.
<cffunction name="">
public boolean function myFunction(required any myArgument) { }
any
any
array
binary
boolean
date
guid
numeric
query
string
struct
UUID
variablename
void
xml
(component name)
public
private
package
public
remote
true
false
JSON
plain
WDDX
true
false
true
false
cfhttp type="URL"
tag.get
post
put
delete
head
options
classic
false
).true
).
classic
modern
abstract
(implementation must be defined in extended component), static
(does not access instance variables in the component) or final
(implementation cannot be extended)
abstract
final
static
abstract
and final
functions in Lucee5+static
functions in Lucee5+public boolean function myFunction(required any myArgument) {
// Some function bits
return true;
}
<cffunction access="public" returntype="boolean" name="myFunction">
<cfargument required="true" type="any" name="myArgument">
<!--- Some function bits --->
<cfreturn true>
</cffunction>
Note that as of now, you cannot declare the access or returntype of an arrow function
myFunction = (required any Arguments) => {
return true;
}
Signup for cfbreak
to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.