You are viewing documentation for v1.0.x. Change

model()

Description

Returns a reference to the requested model so that class level methods can be called on it.

Function Syntax

model(name)

Parameters

Parameter Type Required Default Description
name string Yes Name of the model (class name) to get a reference to.

Examples

<!--- The `model("author")` part of the code below gets a reference to the class in the application scope and then `findByKey` is called on it --->
<cfset authorObject = model("author").findByKey(1)>