I'm just wondering when it comes to Element API is there a way of returning a type of Category.
I'm returning all the other information fine.
'fees.json' => [
'elementType' => 'Entry',
'criteria' => [
'title' => craft()->request->getQuery('title'),
'section' => 'fees',
],
'transformer' => function(EntryModel $entry) {
foreach ($entry->fee as $block) {
$matrixSections[] = [
'first' => $block->firstInstallment,
'second' => $block->secondInstallment,
'full' => $block->full,
'grant' => $block->feeCategory
];
}
return [
'title' => $entry->title,
'menu' => [
'sections' => $matrixSections
]
];
}
]