Skip to content

Configuration

patch()

patch() — returns struct

Available in: mapper Category: Routing

Create a route that matches a URL requiring an HTTP PATCH method. We recommend using this matcher to expose actions that update database records.

NameTypeRequiredDefaultDescription
namestringnoCamel-case name of route to reference when build links and form actions (e.g., blogPost).
patternstringnoOverrides the URL pattern that will match the route. The default value is a dasherized version of name (e.g., a name of blogPost generates a pattern of blog-post).
tostringnoSet controller##action combination to map the route to. You may use either this argument or a combination of controller and action.
controllerstringnoMap the route to a given controller. This must be passed along with the action argument.
actionstringnoMap the route to a given action within the controller. This must be passed along with the controller argument.
packagestringnoIndicates a subfolder that the controller will be referenced from (but not added to the URL pattern). For example, if you set this to admin, the controller will be located at admin/YourController.cfc, but the URL path will not contain admin/.
onstringnoIf this route is within a nested resource, you can set this argument to member or collection. A member route contains a reference to the resource’s key, while a collection route does not.
redirectstringnoRedirect via 302 to this URL when this route is matched. Has precedence over controller/action. Use either an absolute link like /about/, or a full canonical link.