Skip to content

Controller

response()

response() — returns string

Available in: controller Category: Rendering Functions

Returns the content that Wheels is preparing to send back to the client for the current request. This can include the output generated by renderView(), renderPartial(), renderText(), or any other rendering function that has been called during the request lifecycle. Essentially, response() lets you inspect or manipulate the final output before it is sent to the client, which can be particularly useful in testing, debugging, or middleware-style functions.

// Render a view for the current action
renderView(action="show");

// Capture the response content
wheelsResponse = response();

// Log or inspect the response
writeDump(wheelsResponse);