Skip to content

Kirby 3.5.7.1

Array

PHP arrays will automatically be converted to a JSON response

/site/config/config.php
return [
  'routes' => [
    [
      'pattern' => 'custom/response',
      'action'  => function () {
        return [
          'status' => 'ok',
          'data'   => ['foo' => 'bar']
        ];
      }
    ]
  ]
];