- Added support for optional parameters
- Added more tests
- Updated documentation in doc blocks
Optional parameters
$routes->add(
'/demo/{id?}',
function($id = 'defaultValue'){
echo "ID: . $id";
},
Routes::GET
);
When calling this endpoint with /demo
it will output ID: defaultValue
and with /demo/123
it will output ID: 123
Full Changelog: v3.1.6...v3.1.7