If I send a JSON string to my controller that has a nested object in it, rather than just a simple object with a bunch of scalar properties on it, I don't seem to have a way of accessing the nested object effectively. If I 'get' the name of the nested object, I am returned an array of the property values of the nested object, which isn't much use to me. Any hints?
Example:
Sending this:
{"feedback":{"howhear":"Leaflet","comment":"Nice Joomla! site"}}
And accessing it like this:
$app = JFactory::getApplication();
$jinput = $app->input->json;
$feedback = $jinput->get('feedback');
Just gives me:
[ "Leaflet", "Nice Joomla! site" ]
Can I get the object instead using JInputJSON, or do I need to fallback to handling the raw POST data ie via php://input
EDIT:
To clarify, the key benefit I want from using JInputJSON is the filtering capabilities it provides. I know json_decode is available for the task, but it provides no filtering eg. to combat SQL injection attacks.