So if I am reading the code well, if only 1 argument is provided append() uses the page ID as key when adding the page to the data array.
But prepend does not. Instead, it uses php’s unshift() to add the element to the beggining of the data array.
As a result, in my output, when using prepend without a key I get ‘0’ which would be the key of the keyless page in the first position of the data array.
If that is correct, then… why the difference ? sorry if there is an obvious reason, but it does kind of feel counterintuitive.
True, I mixed the classes there.
I see that, but in this previously linked unsolved Kirby2 question, using new Pages() was a way to fix an error. That added to my confusion, and made me use new Pages() everywhere.
Thank you