Controller
Controller
authenticityToken()— Returns the raw CSRF authenticity token for the current user session. This token is used to help protect against Cross-Scaches()— Tells Wheels to cache one or more controller actions. Caching improves performance by storing the output of actions so tclearCachableActions()— Removes one or more actions from the list of cacheable actions in a controller. Use this when you want to prevent previofilterChain()— The filterChain() function returns an array of all filters that are set on the current controller in the order they willfilters()— The filters() function lets you specify methods in your controller that should run automatically either before or afterflash()— The flash() function is used in controllers to access data stored in the Flash scope. Flash is a temporary storage mechaflashClear()— The flashClear() function removes all keys and values from the Flash scope. This is useful when you want to reset or cleflashCount()— The flashCount() function returns the number of keys currently stored in the Flash scope. This is useful to check whetheflashDelete()— The flashDelete() function removes a specific key from the Flash scope. It is useful when you want to delete a particulaflashInsert()— The flashInsert() function adds a new key-value pair to the Flash scope. This is useful for storing temporary messages oflashIsEmpty()— The flashIsEmpty() function checks whether the Flash scope contains any keys. It returns true if the Flash is empty andflashKeep()— The flashKeep() function allows you to preserve Flash data for one additional request. By default, Flash values are onlyflashKeyExists()— The flashKeyExists() function checks whether a specific key is present in the Flash scope. It returns true if the key exgetEmails()— 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 curregetRedirect()— Primarily used in testing scenarios to determine whether the current request has performed a redirect. It returns a struisAjax()— Checks if the current request was made via JavaScript (AJAX) rather than a standard browser page load. This is useful whisDelete()— Checks if the current HTTP request method is DELETE. This is useful for RESTful controllers where different logic is exeisGet()— Checks if the current HTTP request method is GET. Useful for controlling logic depending on whether a page is being dispisHead()— Checks if the current HTTP request method is HEAD. HEAD requests are similar to GET requests but do not return a messageisOptions()— Checks whether the current HTTP request was made using the OPTIONS method. Useful in REST APIs or CORS preflight requestisPatch()— Checks whether the current HTTP request was made using the PATCH method. Useful when building RESTful APIs where PATCH iisPost()— Returns whether the request came from a formPOSTsubmission or not.isPut()— Checks whether the current HTTP request is a PUT request. PUT requests are typically used to update existing resources iisSecure()— Checks whether the current request is made over a secure connection (HTTPS). Returns true if the connection is secure, oonlyProvides()— 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 protectPOSTed requests from CSRF vulnerabilities.provides()— Theprovides()function defines the response formats that a controller can return. Clients can request a specific formredirectTo()— Used to redirect the browser to another page, action, controller, route, or back to the referring page. Internally, it urenderNothing()— Instructs the controller to render an empty response when an action completes. Unlike using cfabort, which stops requestrenderPartial()— Instructs the controller to render a partial view when an action completes. Partials are reusable view fragments, typicarenderText()— Instructs the controller to output plain text as the response when an action completes. Unlike rendering a view or partirenderView()— 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 jsonresponse()— Returns the content that Wheels is preparing to send back to the client for the current request. This can include the ousendEmail()— 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 thepublic/filesfolder in your project or a psetFilterChain()— Provides a low-level way to define the complete filter chain for a controller. This lets you explicitly specify the sequsetFlashStorage()— Dynamically sets the storage mechanism for flash messages during the current request lifecycle. Flash messages are temposetPagination()— Aallows you to define a pagination handle for a custom query so that you can easily generate paginated links and managesetResponse()— Allows you to manually set the content that Wheels will send back to the client for a given request. UnlikerendersetVerificationChain()— Allows you to define the entire verification chain for a controller in a low-level, structured way. Verification chainsusesLayout()— Used inside a controller’sconfig()function to specify which layout template should be applied to the contverificationChain()— Returns an array of all verifications (filters, before-actions, or checks) that are configured for the current controlleverifies()— Instructs a Wheels controller to check that certain criteria are met before executing an action. This is useful for enfo