W
W
WWWWWWWW2017-05-06 14:39:57
Yii
WWWWWWWW, 2017-05-06 14:39:57

What is the best way to create controllers for pages, products and categories?

I can not decide how best to create controllers for products and categories. There are pages Home, Products, About us, Contacts and categories for products Men's, Women's, Children's. My version is ControllerPage for the pages Home, About us, Contacts, ControllerProducts for the Products page - all products are displayed on it, ControllerCategory for the categories Men's, Women's, Children's - products of a separate category are displayed, ControllerProduct for a separate product. Tell me how is it right?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
VisualIdeas, 2017-05-06
@VisualIdeas

You get the controller of the 1st method))) In
theory, the controller: ControllerProducts
And inside:
actionAll
actionByCategory
actionItem
.....

M
Maxim Fedorov, 2017-05-10
@qonand

PageController - for pages Home, About us, Contacts
ProductController - for products and their categories. It makes no sense to create a separate controller for categories, categories are part of the products themselves.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question