php - Slim 3 - Slash as a part of route parameter -
i need compose urls parameters can contain slash /. example, classic /hello/{username}
route. default, /hello/fabien
match route not /hello/fabien/kris
. ask how can in slim 3 framework.
for “unlimited” optional parameters, can this:
$app->get('/hello[/{params:.*}]', function ($request, $response, $args) { $params = explode('/', $request->getattribute('params')); // $params array of optional segments });
Comments
Post a Comment