includePartial()

Description

Includes the specified file in the view. Similar to using cfinclude but with the ability to cache the result and using Wheels specific file look-up. By default, Wheels will look for the file in the current controller's view folder. To include a file relative from the views folder, you can start the path supplied to name with a forward slash.

Function Syntax

includePartial(partial [, group, cache, layout, spacer ])

Parameters

Parameter Type Required Default Description
partial any Yes The name of the file to be used (starting with an optional path and with the underscore and file extension excluded).
group string No Field to group the query by. A new query will be passed into the partial template for you to iterate over.
cache any No See documentation for renderPage().
layout string No See documentation for renderPage().
spacer string No HTML or string to place between partials when called using a query.

Examples

<cfoutput>#includePartial("login")#</cfoutput>
->
If we're in the "admin" controller, Wheels will include the file "views/admin/_login.cfm".

<cfoutput>#includePartial(partial="misc/doc", cache=30)#</cfoutput>
-> If we're in the "admin" controller, Wheels will include the file "views/admin/misc/_doc.cfm" and cache it for 30 minutes.

<cfoutput>#includePartial(partial="/shared/button")#</cfoutput>
-> Wheels will include the file "views/shared/_button.cfm".