How to use getParam () in version 4

Good afternoon community, I would like to know in version 4.0 of the framwork how I retrieve the request parameters. in version 3 getParam = request-> getParam (‘nameParam’) was used, but I have not been able to identify how it is used in version 4. I greatly appreciate what you can support me.

Happy day

Hi @masebas921120

You should find this information it in the Slim 4 documentation.

Option 1: Use the PSR-7 request object, e.g. $request->getQueryParams() or $request->getParsedBody()
Option 2: Use the PSR-7 compatible request object slim/http, e.g. $request->getParam('my-param') or $request->getParsedBodyParam('key')


Thank you very much for the information, we proceed to perform the tests.

have a happy day

1 Like