lau*_*kok 37 slim psr-7 slim-3
我如何能够获得Slim 3中Slim 3中的所有 get/ put/ post变量?
苗条2,
$allGetVars = $app->request->get();
$allPutVars = $app->request->put();
$allPostVars = $app->request->post();
Run Code Online (Sandbox Code Playgroud)
我怎么能在Slim 3中做到这一点?
例如, http://example.com/books/1?title=hello&content=world
我怎样才能在PARAMS title和content小井3呢?
苗条2,
$title = $app->request->get('title');
$content = $app->request->get('content');
Run Code Online (Sandbox Code Playgroud)
我怎么能在Slim 3中做到这一点?
Dav*_*ore 74
获取所有 get/put/post参数:
//GET
$allGetVars = $request->getQueryParams();
foreach($allGetVars as $key => $param){
//GET parameters list
}
//POST or PUT
$allPostPutVars = $request->getParsedBody();
foreach($allPostPutVars as $key => $param){
//POST or PUT parameters list
}
Run Code Online (Sandbox Code Playgroud)
单个参数值:
//Single GET parameter
$getParam = $allGetVars['title'];
//Single POST/PUT parameter
$postParam = $allPostPutVars['postParam'];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
54544 次 |
| 最近记录: |