you wouldn’t render json from a template file.
$app->get('/data', function ($request, $response, $args) {
$yourData = [
'x' => 1
];
return $response->withJson($yourData);
});
you wouldn’t render json from a template file.
$app->get('/data', function ($request, $response, $args) {
$yourData = [
'x' => 1
];
return $response->withJson($yourData);
});