Skip to content

Configuration

wildcard()

wildcard() — returns struct

Available in: mapper Category: Routing

Special wildcard matching generates routes with `

NameTypeRequiredDefaultDescription
methodstringnogetList of HTTP methods (verbs) to generate the wildcard routes for. We strongly recommend leaving the default value of get and using other routing mappers if you need to POST to a URL endpoint. For better readability, you can also pass this argument as methods if you’re listing multiple methods.
actionstringnoindexDefault action to specify if the value for the [action] placeholder is not provided.
mapKeybooleannofalseWhether or not to enable a [key] matcher, enabling a [controller]/[action]/[key] pattern.
mapFormatbooleannofalseWhether or not to add an optional .[format] pattern to the end of the generated routes. This is useful for providing formats via URL like json, xml, pdf, etc.