psr-7

Slim 3 - how to get all get/ put/ post variables?

落爺英雄遲暮 提交于 2019-11-30 10:24:14
问题 How I can get all get/ put/ post variables like in Slim 2 for Slim 3? Slim 2, $allGetVars = $app->request->get(); $allPutVars = $app->request->put(); $allPostVars = $app->request->post(); How can I do that in Slim 3? And, for example, http://example.com/books/1?title=hello&content=world How can I get the params in title and content in Slim 3 now? Slim 2, $title = $app->request->get('title'); $content = $app->request->get('content'); How can I do that in Slim 3? 回答1: Get all get/put/post

Slim 3 - how to get all get/ put/ post variables?

為{幸葍}努か 提交于 2019-11-29 20:36:02
How I can get all get/ put/ post variables like in Slim 2 for Slim 3? Slim 2, $allGetVars = $app->request->get(); $allPutVars = $app->request->put(); $allPostVars = $app->request->post(); How can I do that in Slim 3? And, for example, http://example.com/books/1?title=hello&content=world How can I get the params in title and content in Slim 3 now? Slim 2, $title = $app->request->get('title'); $content = $app->request->get('content'); How can I do that in Slim 3? Get all get/put/post parameters: //GET $allGetVars = $request->getQueryParams(); foreach($allGetVars as $key => $param){ //GET