Hi everyone,
I have a Site
object but I can't figure out how best to store a collection of Page
objects on Site. The pages are hierarchical (a tree structure for a website navigation). I thought about a tree-like array of pages but that would be a pain to interact with - e.g. $site->pages[0][3][1]->addContent('<h1>lol</h1>')
. I could use a flat array of pages with unique IDs like $site->pages['home']->addContent('<p>easier</p>')
but how would I extract a tree from that when it came to rendering navigation?
Can anyone help guide me in the right direction please?
Thanks!