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).
3243
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)?
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.