Controller
response()
Signature
Section titled “Signature”response() — returns string
Available in: controller
Category: Rendering Functions
Description
Section titled “Description”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.
Examples
Section titled “Examples”// Render a view for the current action
renderView(action="show");
// Capture the response content
wheelsResponse = response();
// Log or inspect the response
writeDump(wheelsResponse);