E
E
Evgeny Petrov2018-05-31 12:42:24
PHP
Evgeny Petrov, 2018-05-31 12:42:24

How to implement such a menu on the site?

It is necessary to implement such a menu with the ability to edit / delete / add buttons, groups and links.

img
5b0fc2cad73ba082021293.png5b0fc2d4b9628918027187.png

I had an idea, but apparently a bad one.
Three tables in the database:
1. nav_btns
2. nav_groups
3. nav_links
First we run a loop that gets the buttons.
This loop has another loop that fetches the groups that are bound to the button ID.
Well, and one more cycle that gets the links attached to the group.
Then we combine all the porridge and the cycle works again until it goes through all the buttons
. It seems to work, but with one button, one group and N-links. It’s
worth adding another group - the site takes a very long time to load, once it knocked out a 500 error.
How to implement something like this?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question