Programmatically build panel checkboxes pairs

Hi all,

I try to build value/text pairs feeding a panel checkbox-field.
It partly works (with only values).

Example (simplified):

YML:

checkboxfield:
  type: checkboxes
  options: query
  query: site.retrieveOptions

PHP:

<?php
  Kirby::plugin('this/project', [
    'siteMethods' => [
      'retrieveOptions' => function() {
        $a = [
          'value1',
          'value2'
          ...
        ];

        return $a;
      }
    ]
  ]);
?>

Now, how do I extend it with texts for each value?

  'siteMethods' => [
    'retrieveOptions' => function() {
      return [
        'key1' => 'value1',
        'key2' => 'value2'
      ];

    }
  ]
      checkboxfield:
        type: checkboxes
        options: query
        query:
          fetch: site.retrieveOptions
          text: "{{arrayItem.key}}"
          value: "{{arrayItem.value}}"

That’s a bingo (it works).

Thanks for getting up so early in the morning to solve our small riddles.