Skip to content

Kirby 3.9.8

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']
        ];
      }
    ]
  ]
];