Hi guys
I am new in Slim, so I hope you can help me.
I have structure in POST request:
{
“siteID” : “41”,
“Room_0”:{
“roomID”: “62”,
“roomName”: “Room_1”,
},
“Room_1”:{
“roomID”: “63”,
“roomName”: “Room_2”,
},
“Room_2”:{
“roomID”: “64”,
“roomName”: “Room_3”,
},
“Room_3”:{
“roomID”: “65”,
“roomName”: “WC”,
}
}
routes.php file contain code:
$app->post(API_VERSION . API_POINT . ‘/test’, function() use ($app){
$data = json_decode($app->request->getBody(), true);
$app->render(‘test.php’, array(
‘siteID’ => $data[‘siteID’]
));
});
In test.php file I can use $siteID value and manipulate with it. But how to transmit Room_0[], Room_1[], etc arrays and values inside the arrays? There could be >=0 arrays with “Room_*” name