The web App has four distinct user areas.
- The frontend for people off the street
- The user area for logged in users
- A teacher zone
- An Admin c-panel
I am using CodeIgniter with the HMVC extension.
Here is my current list of module folders. Each database table has a corresponding module.
Each module has a MVC triad except for the admin folder and the teach folder.
The admin folder is like a mini application just for the administrators with multiple controllers each handling an admin url. The admin module looks like this:
Likewise the Teach module is like a mini application just for the teachers. All the controllers are routed to www.example.com/teach/controller/method/param.
It looks like this:
Each module has exactly one model and I am loading the models where and when I need them, so if I need the schedule model in the admin/student controller I simply write:
I can't think of another way I could go about this without making custom routes in the routes.php file for each and every method.
However something does not sit right. I could not find any information on the web about how to structure a site with sub-applications and I have never seen a website structured like how I have it structured.
Everything is working okay but I am interested to know if there is a better way.