Nested structures don't work

I can’t seem to get nested structures to work. It seems like toStructure() converts all yaml content it finds instead of simply “one layer”.

with this Kirby content file:

Nester:

- 
  nested:
    - 
      text: miao

doing this in the template:

<?php 
foreach ($page->nester()->toStructure() as $item) {
  dump($item->nested());
}

gives me this output:

Kirby\Cms\Field Object
(
    [nested] => Array
        (
            [0] => Array
                (
                    [text] => miao
                )
        )
)

nested is an array, while I expected another Field object.
Is the array expected?

You would have to call toStructure() on the nested structure as well

Yeah, I just realized that calling “toStructure” on a field that already contains an array as value (instead of
a yaml string) works anyway. I was just a bit confused because dump($field->toStructure()) gave me something like an array pointing to 0. I guess it’s just a problem with dump and not much with toStructure.

Seems like it’s already too late for me…