Skip to content

Controller

filterChain()

filterChain() — returns array

Available in: controller Category: Configuration Functions

Returns an array of all the filters set on current controller in the order in which they will be executed.

NameTypeRequiredDefaultDescription
typestringnoallUse this argument to return only before or after filters.
// 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));