This is what I would like to do, but I am not sure it works in php.
// create the menu objects
$menuTop = new Menu( );
$menuFile = new Menu( "File" );
$menuEdit = new Menu( "Edit" );
// populate the File menu object
$menuFile->addItem( "/save/", "Save" );
$menuFile->addItem( "/open/", "Open" );
$menuFile->addItem( "/close/", "Close" );
// populate the Edit menu object
$menuEdit->addItem( "/cut.php", "Cut" );
$menuEdit->addItem( "/copy.php", "Copy" );
$menuEdit->addItem( "/paste.php", "Paste" );
/ add the File and Edit submenues to the main menu/
$menuTop->addSubmenu( $menuFile );
$menuTop->addSubmenu( $menuEdit );
Would the above statement work? Passing the instance back to the same class...and if it does..would I be able to access the functions in $menuFile, and $menuEdit by doing something to the effect of
$menuFile->add( "stuff", "/here" );
Thanks in advance,
Bleep