Welcome Guest, Not a member yet? Register   Sign In
MVC structure for page submenu
#1

[eluser]flacznik[/eluser]
Hello, regarding my service structure:

--home
--services
---- x
---- y
---- z
---- ...
--products
---- cars
---- bikes
---- ....
--news
---- january
---- february
---- ...
....

as you can se each part of the site coud be called from the main controller (home) as a function.
For instance:

Code:
public function services(){...}
public function products(){...}

Unfortunately each of the pages has a submenu. Should I make separate controller for each page in that case - the main controller will only serve to view a home page?
#2

[eluser]jairoh_[/eluser]
if the submenus are so many or too big for coding, you can if you want peace of mind debugging. if not, stick to one controller.
#3

[eluser]Alam71[/eluser]
MVC consists of 3 words M=model, V=view, C=controller.

MVC is perfect for group-work. As i mention before this architecture splits your project into some parts so, group members can work and their parts without any dependency. Then you will realize that MVC makes your project more systematic.
It is really easy to edit or change some part of your project that makes less development cost and maintenance cost.
There's an example bellow how to create submenu by using MVC structure :
Here is a link : http://demos.telerik.com/aspnet-mvc/menu...ingtomodel




Theme © iAndrew 2016 - Forum software by © MyBB