Return to v2.2 docs

collection()


Configuration Routing struct mapper


A collection route doesn't require an id because it acts on a collection of objects. photos/search is an example of a collection route, because it acts on (and displays) a collection of objects.


<cfscript>

mapper()
    // Create a route like `photos/search`
    .resources(name="photos", nested=true)
        .collection()
            .get("search")
        .end()
    .end()
.end();

</cfscript>

Related Functions

Routing