My Route is:
$app->get('/api/courts/{id}/{date}','\App\Controllers\AvailabilityController:getCourtAvailability'){
$id=$request->getAttribute('id');
$date=$request->getAttribute('date');
return json_encode();
};
I know that my way is incorrect. Please tell me the correct method as I cannot find any solution
See Route Placeholders and Container Resolution in the docs.
The route:
$app->get('/api/courts/{id}/{date}', '\App\Controllers\AvailabilityController:getCourtAvailability');
Then in your controller:
public function getCourtAvailability($request, $response, $args) {
$id = $args['id'];
$date = $args['date'];
return $response; // your real response
}
thanks for helping @tflight !! 馃憤 馃挴 馃
Most helpful comment
thanks for helping @tflight !! 馃憤 馃挴 馃