Controller
filterChain()
Signature
Section titled “Signature”filterChain() — returns array
Available in: controller
Category: Configuration Functions
Description
Section titled “Description”Returns an array of all the filters set on current controller in the order in which they will be executed.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
type | string | no | all | Use this argument to return only before or after filters. |
Examples
Section titled “Examples”// 1. Get the entire filter chain for the current controller
myFilterChain = filterChain();
// myFilterChain -> array of structs, each with keys: through, type, only, except, arguments
// e.g. [{ through: "checkLogin", type: "before", only: "", except: "" }, ...]
// 2. Get only the before-filters
beforeFilters = filterChain(type="before");
for (f in beforeFilters) {
writeOutput(f.through);
}
// 3. Get only the after-filters
afterFilters = filterChain(type="after");
writeOutput(arrayLen(afterFilters));