Welcome Guest, Not a member yet? Register   Sign In
Best structure for my "Online Shop"
#2

The idea of a base controller is not very MVC.

In my shops I have controllers called 'departmenets' and 'products'. The departments controller calls the departments model that gets products for that department. The method is 'browse' so the url's are something like departments/browse/department_name.

For products the product controller calls a products model that gets all the product details, so the url for a product is something like products/show/product_name.

The home page has its own controller 'home' as that is usually a complex page.

Information pages like 'about us' and 'why shop' are done with an information controller.

The basket has a 'basket' controller and the checkout has a 'checkout' controller, etc.

Hope that helps.

Paul

PS Everyone does these things in different ways but do not have a 'base' controller for all your pages. For instance I have a render_page in my layouts library that deals with the headers and footers and specific elements of any page.
Reply


Messages In This Thread
RE: Best structure for my "Online Shop" - by PaulD - 02-02-2020, 09:30 AM



Theme © iAndrew 2016 - Forum software by © MyBB