View Helpers
includePartial()
Signature
Section titled “Signature”includePartial() — returns string
Available in: controller
Category: Miscellaneous Functions
Description
Section titled “Description”Includes the specified partial file in the view.
Similar to using cfinclude but with the ability to cache the result and use 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 base views folder, you can start the path supplied to partial with a forward slash.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
partial | any | 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. If you want to have Wheels display the partial for a single model object, array of model objects, or a query, pass a variable containing that data into this argument. |
group | string | no | — | If passing a query result set for the partial argument, use this to specify the field to group the query by. A new query will be passed into the partial template for you to iterate over. |
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. |
spacer | string | no | — | HTML or string to place between partials when called using a query. |
dataFunction | any | no | true | Name of controller function to load data from. |
$prependWithUnderscore | boolean | no | true |