![]() |
Calling Controllers - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: Calling Controllers (/showthread.php?tid=43646) |
Calling Controllers - El Forum - 07-19-2011 [eluser]Unknown[/eluser] Im trying to get a base done for a permission based admin system i have to add alot of pages foreach type of admin, so naturally I would want to split that code all i would want to do is if the session isset get the permission (string) from that current logged in user and use it as a way to access another controller (class/method), therefor splitting all those different admin pages into their own //part of the code Code: //in main controler Admin so i could call site.we/admin/somefunc and either be directed to workers/somefunc or coordinators/somefunc depending who logged in with what permission(s) i would have wanted to use the router but i cant access the session there ..so, is there anyway to send the same request to a different controller, from a controller ??? also, im not worried about duplication in cases, like having the same method/page in different controllers like /admin/workers/somefunc and /admin/coordinators/somefunc aslong as i can keep the administrators separate in an easy way thanx in advanced great forum =D Calling Controllers - El Forum - 07-21-2011 [eluser]Unknown[/eluser] Oke after lots of tinkering ive gotten this to work: Code: //in main controler (Admin) extending CI_Controller witch in the end allowed me to use a different class for whatever the user is currently logged into are there other ways of achieving this perhaps if i had Better knowledge of &references; etc |