renderPage()
Description
Renders content to the browser by including the view page for the specified controller and action.
Function Syntax
renderPage([ controller, action, template, layout, cache, returnAs ])
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
controller |
string |
No | [runtime expression] |
Controller to include the view page for. |
action |
string |
No | [runtime expression] |
Action to include the view page for. |
template |
string |
No | |
A specific template to render. |
layout |
any |
No | true |
The layout to wrap the content in. |
cache |
any |
No | |
Minutes to cache the content for. |
returnAs |
string |
No | |
Set to string to return the result to the controller instead of sending it to the browser immediately. |
Examples
<!--- Render a view page for a different action than the current one --->
<cfset renderPage(action="someOtherAction")>
<!--- Render the view page for the current action but without a layout and cache it for 60 minutes --->
<cfset renderPage(layout=false, cache=60)>
