![]() |
How to get data from serializedArray ... (ResourceController)? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: How to get data from serializedArray ... (ResourceController)? (/showthread.php?tid=78231) |
How to get data from serializedArray ... (ResourceController)? - blaasvaer - 12-17-2020 Hi, If I pass data from the client using: Code: (ajax) ... I can easily update a record accessing the data like this: Code: $data = $this->request->getRawInput(); passing it to the model like this: Code: $this->model->update($id, $data); If I wrap that in an object along other data like this: Code: _data = { And try to access the data on the server doing this: Code: $data = $this->request->getRawInput(); It explodes. Now, I've tried fiddling with the format in the ways I can think of ... no luck. Can someone explain why I cannot access the data anymore just because I give it a 'level deeper' ... I don't get it? By the way; I am aware, that I pass an object in the second version and an array in the first ... but no matter HOW I try do json_decode/encode I simply cannot pass the data to the update method on the model ... I can var_dump the result just fine ... but 'something' is happening during the pass to the model (I guess). When I check the output I see some difference ... but cannot figure out where the 'difference' happens. Notice the indexes ( [0] => etc ) in the NOT WORKING OUTPUT. WORKING OUTPUT: Code: responseText: "array(3) {\n NOT WORKING OUTPUT: Code: responseText: "array(3) {\n RE: How to get data from serializedArray ... (ResourceController)? - bindsmoked - 07-16-2024 When I inspect the output, I see that there is a difference, but I am unable to determine the specific location where the 'difference' occurs. Take note of the indices ([0] => etc.) that are present in the output that is not functioning properly. |