Please tell me how to pass variables different from Request and Response to the called function in Slim Framework 4?
Let me explain with an example what I need. For example, I have a route ($app->get('/{id}', [Controller::class, 'id']);) that calls the id method in Controller.
In Controller the function is declared like this: public function id(Request $request, Response $response): Response.
I would like to replace Request and Response with my own variable, which I initialize based on the id that is passed as a parameter.
Here is an example of what I need: public function id(Entity $entity): Response