Return to v2.1 docs


Configuration Routing struct mapper

Scopes any the controllers for any routes configured within this block to a subfolder (package) without adding the package name to the URL.

Name Type Required Default Description
name string Yes Name to prepend to child route names.
package string No [runtime expression] Subfolder (package) to reference for controllers. This defaults to the value provided for name.
// Example URL: /products/1234
// Controller: public.Products
// 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.
// Example URL: /users/4321/profile
// Controller: users.Profiles

Related Functions