Skip to content

Kirby 4.5.0

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