I am making a site for a client and decided i would use code igniter.
The site essentially has two backends, one for designers, and one for a sales team. So after logging in, the user will be redirected to either
- mysite.com/sales/
- mysite.com/design/
The sales team for example can view orders, containers, products, therefore i need a controller for each of these.
- mysite.com/sales/orders/
The sales need to be able to view, edit, delete certain orders…
- mysite.com/sales/orders/vieworder/235433
Basically my problem is i dont have enough url segments to play with.
My thoughts on solving my problem
-
removing the orders, containers, products classes and making ALL of their methods as methods of the sales class, although this would mean a large number of methods and loading all models so it seemed kind of pointless.
-
removing the sales/designer classes and controlling what each kind of user has access to based on a user type stored in session data.
-
a way of having an extra url segment?
I appreciate any advice, I just dont want to get 3 weeks into the project and realise i started wrong from the beginning!
Use folders.
If you make a subfolder in
/application/calledsalesyou can put different controllers in there:Then in
orders.phpyou will put yourvieworders($id)method and so on, and you will be able to acces it withdomain.com/sales/orders/vieworders/id.You can also make subfolders in the
/models/and/views/to organize your files.Now, Access Control is something apart and it depends more in the auth system you are using.