Currently working on some modifications inside a Zend Framework website. One of the things I've been trying to change is the navigation structure and caching of the website. Unfortunate I've came accros a small problem which I, for some reason, cant figure out.
The problem is that I've build up a multi dimensional tree structured array from a database, which I want to pass on to the Zend Navigation class. To me, the array seems legit but Zend throws back the setParent error 'Argument 1 passed to Zend_Navigation_Page::setParent() must be an instance of Zend_Navigation_Container, string given'.
After some debugging and research, I've found a test array (pastebin array) and pasted this in as the first argument array. The array looks (as far I can see) almost the same as my generated array (pastebin array).
I hope someone can help me move on with this problem.
Best regards.
You need to make sure that your array that you are sending to setParent is an instance of Zend_Navigation_Container.
First paste your array through Zend_Navigation() then paste the Instance through the setParent function of Zend_Navigation_Page.