Structure Of Web Application

If I have a projects page that I need to display some content and render the projects sub-functions into that projects page (refer to attachment image).



How should my web application structure be like?

I know that the projects sub-functions should be modules but however what about the projects page?

Should the projects page be a module as well? If so, should the sub-functions modules be child modules of project module (nested modules - within project module there are sub-function modules) or should each of them be standalone modules (project module and sub-functions modules are of the same level)?

What is "sub-function"? Can you give an example?

Maybe Yii’s widgets would fit.

the examples of sub-functions are creating project, managing projects, etc.

project web page is like just rendering all these in sub-functions related to project on the page in different parts of the web page.

Still not clear, sorry.

Why can’t you create one controller ProjectController with actions

index - list pf projects

view - project details

delete - delete project

and so on?

I have a other management stuff that needs to be done such as managing the people that sign-up for the project.

So I thought it would be better to segregate it in modules so that it would be easier to manage the codes later on for the different sub-functions.

If I put all the managing of people, managing of project and creation of project codes into one project controller than later when I need to look for the specific sub-function codes to edit will be difficult right?

My advice is to create a module like admin for all administrative purposes, and create a contrller for each entity, with create, edit and so on.

Don’t create a single giant controller with createUser, createProduct, createCategory and so on, better a UserController, ProductController, CategoryController.

The code of the controller should be small, like the code generated by gii. It is normal to have lot of controller running more or less the same code, don’t create subfunction of the controller code, it is useless and create you problem, just generate with gii or copy/paste it.

Put the useful code in the models instead