Skip to content

Kirby 3.6.6

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