How to implement multi-level menu in the front desk of website in PHP?
我想大声告诉你2017-05-16 13:05:13
0
3
617
How do the front desks of most websites now implement multi-level menus? Of course, these menu data contents are controllable by the server and are in the database, rather than static on the front end
1. Design a menu table with fields similar to <id, url, name, pid, status> (pid is the id of the upper-level menu, the pid of the first-level menu is 0, status is whether to display, design according to your own needs) 2. The frontend generates an array structure based on the data in the table and renders it on the page 3. Of course there is a backend, how to delete, modify and check the data in the table
1. Design a menu table with fields similar to <id, url, name, pid, status> (pid is the id of the upper-level menu, the pid of the first-level menu is 0, status is whether to display, design according to your own needs)
2. The frontend generates an array structure based on the data in the table and renders it on the page
3. Of course there is a backend, how to delete, modify and check the data in the table
-.- It is recommended that Baidu php Infinitus classification
php Infinitus classification
I just found one for you to look at