Greetings everyone.
I'm grabbing JSON data then parsing it to a modx chunk like so:
$url = "//myjsonurl";
$json = file_get_contents($url);
$data = json_decode($json, TRUE);
foreach($data['objects'] as $item){
$output = $modx->getChunk('pets.list.json',array(
'id' => $item['id'],
'mainimage_file_name' => $item['image'],
'name' => $item['name'],
'status' => $item['status'],
'breed' => $item['breed'],
'gender' => $item['gender'],
'birthday' => $item['birthday'],
));
print $output;
}
This works fine - but I need to add pagination ( paginate the results ). Because this is not a xpdo query, I figure I can't use getPage - and will have to figure it out some other way - like using Jquery or just some standard PHP way of doing it.
Thank you in advanced : )