renderPartial()
Description
Instructs the controller to render a partial when it's finished processing the action.
Function Syntax
renderPartial(partial [, cache, layout, returnAs, dataFunction ])
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
partial |
string |
Yes | |
The name of the partial file to be used. Prefix with a leading slash / if you need to build a path from the root views folder. Do not include the partial filename's underscore and file extension. |
cache |
any |
No | |
Number of minutes to cache the content for. |
layout |
string |
No | |
The layout to wrap the content in. Prefix with a leading slash / if you need to build a path from the root views folder. Pass false to not load a layout at all. |
returnAs |
string |
No | |
Set to string to return the result instead of automatically sending it to the client. |
dataFunction |
any |
No | true |
Name of a controller function to load data from. |
Examples
<!--- Render the partial `_comment.cfm` located in the current controller's view folder --->
<cfset renderPartial("comment")>
<!--- Render the partial at `views/shared/_comment.cfm` --->
<cfset renderPartial("/shared/comment")>
