FastRoute
FastRoute copied to clipboard
Return variable as array
Is there a way to get variables returned in an array instead of individually..
Like so
Instead of
$app->get('/nanna/{name}[/{id}[/{product}[/{size}]]]', function($name, $id, $product, $size ) {
Like so
$app->get('/nanna/{name}[/{id}[/{product}[/{size}]]]', function(array $params ) {
And then access in $params ( $params['name'], $params[''id] etcetera) , that would be very useful no need to named variable in route setup et al and so on ..
Currently using Leocavalcante/siler Route and works like this.. but is not maintained anymore and need to use FastRoute (perhaps).. (also multiple optional middle segments AS well which I find useful)
:)