Return to v2.0 docs


Configuration Routing struct mapper

Set any number of parameters to be inherited by mappers called within this matcher's block. For example, set a package or URL path to be used by all child routes.

Name Type Required Default Description
name string No Name to prepend to child route names for use when building links, forms, and other URLs.
path string No Path to prefix to all child routes.
package string No Package namespace to append to controllers.
controller string No Controller to use for routes.
shallow boolean No Turn on shallow resources to eliminate routing added before this one.
shallowPath string No Shallow path prefix.
shallowName string No Shallow name prefix.
constraints struct No Variable patterns to use for matching.

    // All routes inside will use the `freeForAll` controller.
        .get(name="bananas", action="bananas")

    // All routes's controllers inside will be inside the `public` package/subfolder.
        .resource(name="search", only="show,create")

    // All routes inside will be prepended with a URL path of `phones/`.
        .get(name="newest", to="phones##newest")
        .get(name="sortOfNew", to="phones##sortOfNew")


Related Functions