25 lines
644 B
PHP
25 lines
644 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
$specificData = [
|
||
|
|
'intro' => [
|
||
|
|
'title' => $page->intro_title()->value(),
|
||
|
|
'text' => $page->intro_text()->value()
|
||
|
|
],
|
||
|
|
'sections' => $page->expertise_sections()->toStructure()->map(function($section) {
|
||
|
|
return [
|
||
|
|
'title' => $section->title()->value(),
|
||
|
|
'icon' => $section->icon()->value(),
|
||
|
|
'content' => $section->content()->toBlocks()
|
||
|
|
];
|
||
|
|
})->values(),
|
||
|
|
'objective' => [
|
||
|
|
'title' => $page->objective_title()->value(),
|
||
|
|
'text' => $page->objective_text()->value()
|
||
|
|
]
|
||
|
|
];
|
||
|
|
|
||
|
|
$pageData = array_merge($genericData, $specificData);
|
||
|
|
|
||
|
|
header('Content-Type: application/json');
|
||
|
|
echo json_encode($pageData);
|