How to get /, /article to map to same action in PHP Slim
I want to map two routes : / and /articles to the same action list_articles.
I tried using this code but it's not working.
$app->get('/:route', function () use($app, $layout) {
echo "test"
})->conditions(array("route" => "(/|articles)"))->name('list_articles');
What am I typing wrong?
No comments:
Post a Comment