Access podio return value
I am accessing a contact app using the following code
$items = PodioItem::filter(14900000, array(
'filters' => array('name' => 'name-of-user')
));
$id='name';
echo ($items->field($id));
However I cannot display the field values. Can you please tell me how to access the fields. Thank you
-
Hi Indika,
You can check out the docs for the Podio PHP library - specifically the bit about working with item fields at: http://podio.github.io/podio-php/items/
Cheers,
Brian
-
Hi Indika,
Depending on the field type you have to access the content slightly differently (see http://podio.github.io/podio-php/fields/ for examples). But this should be enough to get you started
$items = PodioItem::filter($app_id);
$item = $items[0];
foreach ($item->fields as $i => $value) {
print $value->field_id . " (" . $value->type . "): " . $value->values . "\n";
}Cheers,
Brian
Please sign in to leave a comment.
Comments
4 comments