Configuration
member()
Signature
Section titled “Signature”member() — returns struct
Available in: mapper
Category: Routing
Description
Section titled “Description”Scope routes within a nested resource which require use of the primary key as part of the URL pattern; A member route will require an ID, because it acts on a member. photos/1/preview is an example of a member route, because it acts on (and displays) a single object.
Examples
Section titled “Examples”<cfscript>
// 1. Add a preview route acting on a single photo (GET /photos/1/preview)
mapper()
.resources(name="photos", nested=true)
.member()
.get("preview")
.end()
.end()
.end();
// 2. Add multiple member routes (GET /articles/1/publish, DELETE /articles/1/archive)
mapper()
.resources(name="articles", nested=true)
.member()
.get("publish")
.delete("archive")
.end()
.end()
.end();
</cfscript>