Back
package()
Scopes any the controllers for any routes configured within this block to a subfolder (package) without adding the package name to the URL.
<cfscript> mapper() .package("public") // Example URL: /products/1234 // Controller: public.Products .resources("products") .end() // Example URL: /users/4321 // Controller: Users .resources(name="users", nested=true) // Calling `package` here is useful to scope nested routes for the `users` // resource into a subfolder. .package("users") // Example URL: /users/4321/profile // Controller: users.Profiles .resource("profile") .end() .end() .end(); </cfscript>
Copied!