Reputation: 1154
I'm having problems getting routes with parameters to work in Slim 3 RC.
$app->get('/hello/:name', function($req, $res, $args) {
echo "Hello {$name}";
});
Visiting /hello/joe
results in 404.
Other routes work fine, e.g.:
$app->get('/', HomeAction::class . ":dispatch");
$app->get('/services', ServicesAction::class . ":dispatch");
I am using the built-in PHP server while I am developing. I do not have any .htaccess
file. I have tried the suggested route.php
suggestion and the accepted answer from this question but it does not work. Any suggestions please?
Upvotes: 7
Views: 3349