![]() |
Path organization - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=31) +--- Thread: Path organization (/showthread.php?tid=81078) |
Path organization - fagnerdin - 01-21-2022 Hello everyone! I know and understand that the organization of folders is by convention, but I would like a technical explanation of which scenario to use according to the organization that I show below: About CI4..., does it make sense to create a folder for each system, even if it is a distributed system for different areas of the company, but which can request common calls? For example: Scenario 1: date/www/sites/ | -- system1/app/[controllers, Model, Views] | -- system2/app/[controllers, Model, Views] | -- system3/app/[controllers, Model, Views] Scenario 2: date/www/sites/ | -- general_system/app/ | -- controllers/ | -- system1.php | -- system2.php | -- system3.php | -- Views/ | -- system1.php | -- system2.php | -- system3.php What would be the best practice, scenario 1 or scenario 2? Thank you all, see you later. RE: Path organization - kenjis - 01-23-2022 What do you mean by "can request common calls"? Scenario 2 seems unrealistic. One system has only one controller? RE: Path organization - fagnerdin - 01-25-2022 I wanna mean what's is the best way, scenario 1 or 2? Make different systems in a same controller/view/model path OR I need to use different path of Codeigniter Framework for each system? Let's say that system will have salles users and financial account users... a both of users will use a function to know "how much money client expend in that mounth"... I have to make a path of complete condeigniter to put both system or one condeigniter path for each system? Scenario 1 www/ | -- my_system/App/[both systems] Scenario 2 www/ | -- my_system_financial/App/[System 1] | -- my_system_salles/App/[System 2] RE: Path organization - fagnerdin - 01-25-2022 [quote pid="393232" dateline="1642922824"] "One system has only one controller?" [/quote] No, they will not use the same controller, but, in a most of time, they will use same functions and requests (model database). And they will also use the same page template. I not wanna make the same function to a both of systems. It is a best practice to make the same function to each system? Is there a possibility to avoid a redundancy in this case? |