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....
/controller/dashboard.php
Within that controller I have a function for the different sections. I check run a check to see if a usergroup has permissions to a section...etc. So, the URL might be something like this...
/dashboard/pages/add
I know I can setup a subfolder and have my URL be like the following....
/dashboard/staff/pages/add
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.
I can't do the following either....
$this->load->controller();
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 } Hoping you guys will have some ideas for me!
Thanks, Jacob