I have route:
$app->get('/admin/login/{status}', 'App\Controller\Admin\AdminController:loginAction')
How do I make {status} parameter optional?
I have route:
$app->get('/admin/login/{status}', 'App\Controller\Admin\AdminController:loginAction')
How do I make {status} parameter optional?
use square brackets:
$app->get('/admin/login[/{status}]', 'App\Controller\Admin\AdminController:loginAction')
See http://www.slimframework.com/docs/objects/router.html#route-placeholders
© 2022 - 2024 — McMap. All rights reserved.