Controller
renderText()
Signature
Section titled “Signature”renderText() — returns void
Available in: controller
Category: Rendering Functions
Description
Section titled “Description”Instructs the controller to render specified text when it’s finished processing the action.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
text | string | no | — | The text to render. |
status | any | no | [runtime expression] | Force request to return with specific HTTP status code. |
Examples
Section titled “Examples”// Render just the text "Done!" to the client
renderText("Done!");
// Render serialized product data to the client
products = model("product").findAll();
renderText(SerializeJson(products));