Skip to content

Miscellaneous

controller()

controller() — returns any

Creates and returns a controller object with your own custom name and params. Used primarily for testing purposes.

NameTypeRequiredDefaultDescription
namestringyesName of the controller to create.
paramsstructyes[runtime expression]The params struct (combination of form and URL variables).
controller(name [, params ]) <cfset testController = controller("users", params)>