Welcome Guest, Not a member yet? Register   Sign In
Same tasks in each controller: controller inheritance?
#1

[eluser]sl3dg3hamm3r[/eluser]
Hey there

I just wanted to ask for some advice if I am on the right track. Supposed I need to build an administration area, each controller which handles this area would need to check if the user is really logged in as administrator before letting him do anything.

I thought I would write then first a general admin-controller who would check this in the constructor, and all other controllers would inherit from this one. This makes sure I won't forget this check anywhere. Similar to this example.

Does this make sense to you experienced code-igniters, or is there a more elegant, better way?

Glad for any hint :-)
Oliver


Messages In This Thread
Same tasks in each controller: controller inheritance? - by El Forum - 10-10-2008, 05:57 AM
Same tasks in each controller: controller inheritance? - by El Forum - 10-10-2008, 06:16 AM
Same tasks in each controller: controller inheritance? - by El Forum - 10-10-2008, 06:40 AM
Same tasks in each controller: controller inheritance? - by El Forum - 10-10-2008, 06:45 AM
Same tasks in each controller: controller inheritance? - by El Forum - 10-10-2008, 06:48 AM
Same tasks in each controller: controller inheritance? - by El Forum - 10-10-2008, 09:24 AM
Same tasks in each controller: controller inheritance? - by El Forum - 10-10-2008, 09:41 AM
Same tasks in each controller: controller inheritance? - by El Forum - 10-10-2008, 09:54 AM
Same tasks in each controller: controller inheritance? - by El Forum - 10-11-2008, 01:26 AM
Same tasks in each controller: controller inheritance? - by El Forum - 10-11-2008, 03:38 AM



Theme © iAndrew 2016 - Forum software by © MyBB