V
V
Vladimir Borisyuk2018-03-15 16:03:57
PHP
Vladimir Borisyuk, 2018-03-15 16:03:57

How to achieve dynamic creation of pages and menu items in PHP MVC?

How to achieve dynamic creation of pages and menu items in PHP MVC? In my understanding, MVC consists of 3 components: controller, model, view. For example, the home page consists of (controllerHome, viewHome, modelHome), everything is clear with this, but what if it is not known in advance how many pages there will be and what they will be called? The task is that a person in the admin panel could create menu items and corresponding pages. For example, a person decided to create an "About us" page, in the admin panel he first creates a menu item, gives it the name "About us" and the Key "about", Then he creates a page with text and binds it to the category page_cat = 'about'. What about controller, model and view? To generate them or is one controller responsible for everything?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
maddog670, 2018-03-15
@Flight404

Of course, one controller for creating such pages with its own logic for creating, editing and deleting pages. PagesController, PagesModel, PagesView.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question