Configuration
collection()
Signature
Section titled “Signature”collection() — returns struct
Available in: mapper
Category: Routing
Description
Section titled “Description”Defines a collection route in your Wheels application. Collection routes operate on a set of resources and do not require an id, unlike member routes which act on a single resource. This is useful when building actions that retrieve, filter, or display multiple objects, such as search pages, listings, or batch operations.
Examples
Section titled “Examples”
<cfscript>
mapper()
// Create a route like `photos/search`
.resources(name="photos", nested=true)
.collection()
.get("search")
.end()
.end()
.end();
</cfscript>