Closed marcus-at-localhost closed 5 years ago
Export just the variables you really need to JavaScript.
I can do that. Could you please give a hint/link what the idea behind this kind of tree is, that it consists of references and that it is ending in an infinit loop when using a recursive function? (In this case Twig). I'm curious, because I've never seen that before. Thank you!
The references are necessary to access the page tree array from the pages array and vice-versa. A page references its corresponding node in the page tree, and the node back-references its page. This back-reference is causing the infinite loop in many functions (including json_encode
). For Pico 3.0 we're planning to replace both the pages array and the page tree array with objects, so that json_encode
won't stumble over this anymore (that's not the primary goal of this change (it's for performance reasons), but it's a nice side-effect).
I'm looking forward to version 3!
Hi, after updating to v 2.0 I have trouble to deal with the
pages
and all the recursiveness.before I was using something like this in my twig template:
but that is not possible anymore (it ends up in 1GB error log because of some array_walk_recursive() in twig) Is it because all leaves are added as &references? How to deal with this tree? - I read something about it here: http://picocms.org/in-depth/features/page-tree/ but it doesn't really apply.
Thanks.