[eluser]grahoom[/eluser]
Hello,
I was wondering - I have a Model, that I am using for navigation.
I am wanting to create another function that creates a heirachical menu structure from pages that are stored in my DB.
at present I have pages that have a field in the table that can be set to say if the page is a container (and also a field in a page that can be set to state what the pages parent is)
So For example
Page 1
Page 2
Page 3
- Page 4
- Page 5
- Page 8
Page 6
Page 7
Where Page 4 and 5 Parent is Page 3 (and Page 1, 2, 3 ,6 ,7 parent is effectively 0 - as I am using 0 as a reference to site root)
What I want to do is create a recursive function that is called within my model so that I can create this heirachical menu structure.
How do I go about calling a function that is within a Model from another function that is within the same Model (is this actually possible?)
I tried just using
generate_navigation($navigation_root)
from within a function in my model but I get the error
Fatal error: Call to undefined function generate_navigation()
so How do you call a function that is in a Model from that same Model ?