PHP Classes

PHP Menu Generator: Generate nested menus with HTML list items

Recommend this page to a friend!
  Info   View files Example   View files View files (5)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 49%Total: 759 All time: 4,439 This week: 86Up
Version License PHP version Categories
menu-generator 2.3Free For Educatio...5HTML, Templates, Design Patterns


This class can generate nested menus with HTML list items.

It can compose a menu by adding root items and child items to its definition.

Menu items may be defined by text and optional links. The menu styles can be defined using CSS classes.

The class can also modify or remove items.

The composed menu can generate as an HTML list of items and saved to a file.

The class can also show the generated menu by loading the generated menu file.

Picture of mohamad Reza kavoosi
  Performance   Level  
Name: mohamad Reza kavoosi is available for providing paid consulting. Contact mohamad Reza kavoosi .
Classes: 5 packages by
Country: Iran Iran
Age: 35
All time rank: 7926 in Iran Iran
Week rank: 358 Up6 in Iran Iran Equal
Innovation award
Innovation award
Nominee: 1x

Winner: 1x


require_once 'menuClass.php';
$menu->addRootItem('item2')->addChild('my profile','','_blank');

//to remove ITEM :
//TO Add css class for MENU,root item,child item :
 $menu->cssClass= "classNames";
 $menu->GetItemByPath('0\1')->cssClass= "classNames";
//TO modify or edit Feature item :
$menu->GetItemByPath('0\0\1')->title = "enter new title";
$item1->title = "enter new title";
if ($menu->save())
"The menu was created,Now you can <a href='index.php'>see menu</a>";


with this class you can create and generate menu and list. Features this class is: 1- add items 2- add sub items 3- add css class for menu and items 4- access childs with path address 5- remove child 6- modify and edit childs 7- save menu

  Files folder image Files  
File Role Description
Accessible without login Plain text file create.php Example create and modify menu at this file
Accessible without login Plain text file index.php Example example of how to use and show generated menu
Plain text file menuClass.php Class main class
Accessible without login Plain text file readme.txt Data read me file
Accessible without login Plain text file style.css Data style of menu

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:4,439
This week:86Up
User Ratings User Comments (2)
 All time
Good job.
8 years ago (alexandru traian)
HI Public members, Capital and small letter mixed, base64 fo...
8 years ago (keran)