Miva - As API
<mvt:assign name="l.header" value="miva_output_header( 'Content-Type', 'application/json' )" />
<mvt:if expr="g.get EQ 'sub_categories' AND g.Category_Code">
<mvt:do name="l.result" file="g.Module_Library_DB" value="Category_Load_Code( g.Category_Code, l.settings:category )" />
<mvt:do name="l.result" file="g.Module_Library_DB" value="CategoryList_Load_Parent( l.settings:category:id, l.settings:sub_categories )" />
[
<mvt:foreach iterator="sub_category" array="sub_categories">
{
"active": "&mvt:sub_category:active;",
"agrpcount": "&mvt:sub_category:agrpcount;",
"code": "&mvt:sub_category:code;",
"disp_order": "&mvt:sub_category:disp_order;",
"id": "&mvt:sub_category:id;",
"name": "&mvt:sub_category:name;",
"parent_id": "&mvt:sub_category:parent_id;"
}
</mvt:foreach>
]
</mvt:if>