Re: [PHP4BETA] Class member variable bug???
| From: | Brad Handy | Date: | Fri, 21 Jan 2000 19:21:44 +0000 |
| Subject: | Re: [PHP4BETA] Class member variable bug??? | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-9345@lists.php.net to get a copy of this message | ||
I would try this:
$mn_1=new MenuNode("Main1","http://main1.com");
$mn_2=new MenuNode("Sub2","http://sub2.main.com");
$mn_3=new MenuNode("Sub3","http://sub3.main.com");
$mn_4=new MenuNode("Sub4","http://sub4.main.com");
$mn_5=new MenuNode("Sub5","http://sub5.main.com");
$mn_6=new MenuNode("Sub6","http://sub6.main.com");
$mn_7=new MenuNode("Sub7","http://sub7.main.com");
$mn_2->addBranch($mn_4);
echo "<hr>";
$mn_2->addBranch($mn_6);
echo "<hr>";
$mn_3->addBranch($mn_5);
echo "<hr>";
$mn_3->addBranch($mn_7);
echo "<hr>";
$mn_1->addBranch($mn_2);
echo "<hr>";
$mn_1->addBranch($mn_3);
echo "<hr>";
Basically you need to handle the children nodes before you handle the parent
nodes. That way you don't get counts misreported. This is only a
suggestion. There are many different ways to do it. But the strategy stays
the same.
--Brad Handy