This PHPMaker 2024 project will show you how to load Menu Items dynamically from Database in web applications that generated by PHPMaker.
You will learn how to load menu items from Database and then display it on Sidebar and/or Top Navbar dynamically via Menu_Rendering server event. This is very useful if you don't want to use the static menu that by default defined in Menu Editor of your PHPMaker 2024 project.
This project is actually contains one table in Database to store the menu items. There are 13 (Thirteen) fields in this table, which will represent the number of param in addMenuItem method that belongs to the Menu object.
You may simply add, update, delete the records in this menus table, via User Interface of the generated web application. The changes you made in that table will automatically be applied into Menu section (whether on Sidebar or Navbar) dynamically.
This project will more prove that PHPMaker 2024 is a very powerful tool to generate web applications dynamically. It is very ease to use, and very quick to load Menu Items dynamically from Database. You only need to add a few lines of code in Menu_Rendering server event.
After using this project, then you will know how to define the Menu Items in Database, so that you may create your menu structure that suits your needs. For example, in this demo, you will see how you can make submenu items under a submenu item that located in Top Navbar.
Last but not least, here are some links that will help you to restore some data sample, including the action to reset the database by removing all the records in menus table. When all records in this table are deleted, then the menu items from Menu Editor will be used.