Optional Paramter

Hi,

how to pass option paramter in url. For example my required url is:
http://localhost/test/param1/param2

While param2 is optional so I want to call url like
http://localhost/test/param1

but this is generating 404 error since it does’t match url

Code:

$app->get("/test/:p1/:p2", function() use ($app) {

});

If I understand correctly - you’re using slim 2.

Please check docs here: http://docs.slimframework.com/routing/params/