Skip to content

Controller

processRequest()

processRequest() — returns any

Available in: controller, model, mapper, migrator, migration, tabledefinition Category: Miscellaneous Functions

Creates a controller and calls an action on it. Which controller and action that’s called is determined by the params passed in. Returns the result of the request either as a string or in a struct with body, emails, files, flash, redirect, status, and type. Primarily used for testing purposes.

NameTypeRequiredDefaultDescription
paramsstructyesThe params struct to use in the request (make sure that at least controller and action are set).
methodstringnogetThe HTTP method to use in the request (get, post etc).
returnAsstringnoPass in struct to return all information about the request instead of just the final output (body).
rollbackstringnofalsePass in true to roll back all database transactions made during the request.
includeFiltersstringnotrueSet to before to only execute “before” filters, after to only execute “after” filters or false to skip all filters.