Skip to content

Controller

Controller

  • authenticityToken() — Returns the raw CSRF authenticity token for the current user session. This token is used to help protect against Cross-S
  • caches() — Tells Wheels to cache one or more controller actions. Caching improves performance by storing the output of actions so t
  • clearCachableActions() — Removes one or more actions from the list of cacheable actions in a controller. Use this when you want to prevent previo
  • filterChain() — The filterChain() function returns an array of all filters that are set on the current controller in the order they will
  • filters() — The filters() function lets you specify methods in your controller that should run automatically either before or after
  • flash() — The flash() function is used in controllers to access data stored in the Flash scope. Flash is a temporary storage mecha
  • flashClear() — The flashClear() function removes all keys and values from the Flash scope. This is useful when you want to reset or cle
  • flashCount() — The flashCount() function returns the number of keys currently stored in the Flash scope. This is useful to check whethe
  • flashDelete() — The flashDelete() function removes a specific key from the Flash scope. It is useful when you want to delete a particula
  • flashInsert() — The flashInsert() function adds a new key-value pair to the Flash scope. This is useful for storing temporary messages o
  • flashIsEmpty() — The flashIsEmpty() function checks whether the Flash scope contains any keys. It returns true if the Flash is empty and
  • flashKeep() — The flashKeep() function allows you to preserve Flash data for one additional request. By default, Flash values are only
  • flashKeyExists() — The flashKeyExists() function checks whether a specific key is present in the Flash scope. It returns true if the key ex
  • getEmails() — Primarily used in testing scenarios to retrieve information about the emails that were sent during the current request.
  • getFiles() — The getFiles() function is primarily used in testing scenarios to retrieve information about files sent during the curre
  • getRedirect() — Primarily used in testing scenarios to determine whether the current request has performed a redirect. It returns a stru
  • isAjax() — Checks if the current request was made via JavaScript (AJAX) rather than a standard browser page load. This is useful wh
  • isDelete() — Checks if the current HTTP request method is DELETE. This is useful for RESTful controllers where different logic is exe
  • isGet() — Checks if the current HTTP request method is GET. Useful for controlling logic depending on whether a page is being disp
  • isHead() — Checks if the current HTTP request method is HEAD. HEAD requests are similar to GET requests but do not return a message
  • isOptions() — Checks whether the current HTTP request was made using the OPTIONS method. Useful in REST APIs or CORS preflight request
  • isPatch() — Checks whether the current HTTP request was made using the PATCH method. Useful when building RESTful APIs where PATCH i
  • isPost() — Returns whether the request came from a form POST submission or not.
  • isPut() — Checks whether the current HTTP request is a PUT request. PUT requests are typically used to update existing resources i
  • isSecure() — Checks whether the current request is made over a secure connection (HTTPS). Returns true if the connection is secure, o
  • onlyProvides() — Use this in an individual controller action to define which formats the action will respond with.
  • pagination() — Returns a struct with information about the specificed paginated query.
  • processAction() — Process the specified action of the controller.
  • processRequest() — Creates a controller and calls an action on it.
  • protectsFromForgery() — Tells Wheels to protect POSTed requests from CSRF vulnerabilities.
  • provides() — The provides() function defines the response formats that a controller can return. Clients can request a specific form
  • redirectTo() — Used to redirect the browser to another page, action, controller, route, or back to the referring page. Internally, it u
  • renderNothing() — Instructs the controller to render an empty response when an action completes. Unlike using cfabort, which stops request
  • renderPartial() — Instructs the controller to render a partial view when an action completes. Partials are reusable view fragments, typica
  • renderText() — Instructs the controller to output plain text as the response when an action completes. Unlike rendering a view or parti
  • renderView() — Instructs the controller which view template and layout to render when it’s finished processing the action.
  • renderWith() — Instructs the controller to render the given data in the format requested by the client. If the requested format is json
  • response() — Returns the content that Wheels is preparing to send back to the client for the current request. This can include the ou
  • sendEmail() — Sends an email using a template and an optional layout to wrap it in.
  • sendFile() — Sends a file to the client. By default, it serves files from the public/files folder in your project or a p
  • setFilterChain() — Provides a low-level way to define the complete filter chain for a controller. This lets you explicitly specify the sequ
  • setFlashStorage() — Dynamically sets the storage mechanism for flash messages during the current request lifecycle. Flash messages are tempo
  • setPagination() — Aallows you to define a pagination handle for a custom query so that you can easily generate paginated links and manage
  • setResponse() — Allows you to manually set the content that Wheels will send back to the client for a given request. Unlike render
  • setVerificationChain() — Allows you to define the entire verification chain for a controller in a low-level, structured way. Verification chains
  • usesLayout() — Used inside a controller’s config() function to specify which layout template should be applied to the cont
  • verificationChain() — Returns an array of all verifications (filters, before-actions, or checks) that are configured for the current controlle
  • verifies() — Instructs a Wheels controller to check that certain criteria are met before executing an action. This is useful for enfo