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

setResponse()

Description

Sets content that Wheels will send to the client in response to the request.

Function Syntax

setResponse(content)

Parameters

Parameter Type Required Default Description
content string Yes The content to set as the response.

Examples

<!--- In a controller --->
<cffunction name="init">
    <cfset filters(type="after", through="translateResponse")>
</cffunction>

<!--- After filter translates response and sets it --->
<cffunction name="translateResponse">
    <cfset var wheelsResponse = response()>
    <cfset var translatedResponse = someTranslationFunction(wheelsResponse)>
    <cfset setResponse(translatedResponse)>
</cffunction>