Overview
Named Params
This guide assumes you have read Simple RoutingBasically, Dynamic Placeholder-based Route Patterns are just another way to use routes dynamically. This type of Route Patterns are the same as Dynamic PCRE-based Route Patterns, but with one difference: they don't use regexes to do the pattern matching but they use the more easy placeholders instead. Placeholders are strings surrounded by curly braces, e.g. {name}. You don't need to add parens around placeholders.
Examples
- /movies/{id}
- /profile/{username}
Placeholders are easier to use than PRCEs, but offer you less control as they internally get translated to a PRCE that matches any character (.*).
Note: the name of the placeholder does not need to match with the name of the parameter that is passed into the route handling function...although it's adviced:
Next Steps
Optional sub-patternsSimple Authentication
Request
Response