I am trying to create a Dynamic Dropdown menu class
which contains
a class
Menu
and MenuItem class.
menu class Iterates over the menu Items. using methods
function load
function hasNext
function next
function current
And menutItem class contains information about like URL, LinkText, IsActive
but my problem is the menuitem may have in turn also Children. And I am unable to solve this problem, how should I store and display the Children of a MenuItem
Set one patent_id for first level menu has patent_id = 0 and all other have specific value
set function hasChild() and pass this parent id as a argument and based on this generate the child menu
call this function recursive so it will generate all tree structure