array, you can listen for multiple HTTP methods on the same handler:
<handler>placeholder you saw is where you can put the route logic and it can be contained on the following:
path/to/filesmatching the HTTP URI according to the table below:
}are valid chars in a filename, route parameters should work as well, but you can define required parameters prefixing with
$and optional parameters using
FooControllerconstructor for each request even if it's not a request to
FooControlleris called only when there is a match for route
/foo. One downside is that now you have to explicitly manage path parameters, on the other hand is a best practice to do so. It is a good time to validate parameters, convert plain string parameters to meaningful types on your domain or resolve dependencies.