• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Organizing Controllers into Subfolders

I'm building a site using CodeIgniter and up until now things have been going great. However, recently one of my controllers has been growing in size. I'd like to split the controller up into separate files within a sub-folder. Right now I have the following....


Within that controller I have a functions for all the different sections. So, the URL might be something like this...


I know I can setup a subfolder and have my URL be like the following....


But, I'd like to omit the 'usergroup' if at all possible. I'd like to do this by the following....

/controllers/dashboard/ -> If staff load staff.php, if user load user.php...etc.

This would be so much easier if I could just go....


How would you suggest I setup a dashboard area? Each usergroup has different things they need to access. Putting everything in one document is getting too long, and separating them out means I have to put the usergroup in the URL....yucky.

Is it possible to run a check in routes.php?

if ($this->user_model->is_user()) {
  // load this controller

Hope you guys have some suggestions for me!

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.