Skip to content

Controller

onlyProvides()

onlyProvides() — returns void

Available in: controller Category: Provides Functions

Use this in an individual controller action to define which formats the action will respond with. This can be used to define provides behavior in individual actions or to override a global setting set with provides in the controller’s config().

NameTypeRequiredDefaultDescription
formatsstringnoFormats to instruct the controller to provide. Valid values are html (the default), xml, json, csv, pdf, and xls.
actionstringno[runtime expression]Name of action, defaults to current.
// This will only provide the `html` type and will ignore what was defined in the call to `provides()` in the `config()` function
onlyProvides("html");