Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.2.2

Doc Bug #16718 sample simple example fails
Submitted: 2009-10-20 22:32 UTC
From: jangkro Assigned: kguest
Status: Closed Package: HTML_TreeMenu (version 1.2.1)
PHP Version: 5.2.5 OS: windows xp 64 bit sp3
Roadmaps: (Not assigned)    

 [2009-10-20 22:32 UTC] jangkro (Jang Kro)
Description: ------------ Not only does the example have an infinite loop, but each line of this infinite loop results in a syntax error. Even if I fix the syntax error by say putting a + sign between the $i and the numbers for each line within the for loop, I still have an infinite loop. If I put the ++ after the $i, the images referred to would not exist anyway. Test script: --------------- <?php require_once 'HTML/TreeMenu.php'; $menu_styles = new HTML_TreeNode(array('text'=>'Styles')); $menu_pays = new HTML_TreeNode(array('text'=>'Countries')); $menu_restaurants = new HTML_TreeNode(array('text'=>'Restaurants')); $menu_plats = new HTML_TreeNode(array('text'=>'Menus')); for ($i = 1; $i < 10; $i) { $menu_styles->addItem(new HTML_TreeNode(array('icon'=>'Image '.($i 0)))); $menu_pays->addItem(new HTML_TreeNode(array('icon'=>'Image '.($i 10)))); $menu_restaurants->addItem(new HTML_TreeNode(array('icon'=>'Image '.($i 20)))); $menu_plats->addItem(new HTML_TreeNode(array('icon'=>'Image '.($i 30)))); } $menu = new HTML_TreeMenu(); $menu->addItem($menu_styles); $menu->addItem($menu_pays); $menu->addItem($menu_restaurants); $menu->addItem($menu_plats); // Chose a generator. You can generate DHTML or a Listbox $tree = new HTML_TreeMenu_DHTML($menu); echo $tree->toHTML(); ?> Expected result: ---------------- Expect to see a sample tree. Actual result: -------------- Parse error: syntax error, unexpected T_LNUMBER


 [2010-04-18 23:11 UTC] kguest (Ken Guest)
-Assigned To: +Assigned To: kguest
 [2010-04-18 23:51 UTC] kguest (Ken Guest)
-Status: Assigned +Status: Closed
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.