A
A
alestro2015-10-10 17:47:58
PHP
alestro, 2015-10-10 17:47:58

How to implement a mega menu in php?

What is the organization of the database and code.
I would like to find a good Russian-language source describing this issue.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
K
Kukushkin Ivan, 2015-10-10
@deleted-webter

1) storage of a tree structure in the database - parent - child
2) Recursive construction procedure in php

M
Maxim Timofeev, 2015-10-10
@webinar

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.

E
Evgeny Bezymyannikov, 2015-10-11
@psman

Or even json.
need more input data and restrictions

E
Evgeny Petrov, 2015-10-10
@EvgenZZ

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 question

Ask a Question

731 491 924 answers to any question