Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
1) storage of a tree structure in the database - parent - child
2) Recursive construction procedure in php
It all depends on the following factors:
1. level of nesting
2. frequency and degree of change
Solutions can be different depending on the need. If the menu is expected at 2-3 levels, you can store the nesting level in the base of the ancestor. If the level is unknown, then the nested sets method can be used ( www.getinfo.ru/article610.html). There are a couple more methods, but in my opinion more from the category of beautiful theories than practical applications.
it's bad to write a mega menu in php, at least in a template using jQuery + Ajax
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question