Slim PHP and GET Parameters

后端 未结 9 518
猫巷女王i
猫巷女王i 2021-01-30 03:56

I\'m playing with Slim PHP as a framework for a RESTful API, and so far it\'s great. Super easy to work with, but I do have one question I can\'t find the answer to. How do I gr

9条回答
  •  滥情空心
    2021-01-30 04:35

    For Slim 3/4 you need to use the method getQueryParams() on the PSR 7 Request object.

    Citing Slim 3 / Slim 4 documentation:

    You can get the query parameters as an associative array on the Request object using getQueryParams().

提交回复
热议问题