Welcome Guest, Not a member yet? Register   Sign In
Extending admin controllers from a general controller
#1

[eluser]Bramme[/eluser]
Hey all

I'm working on an app that has a series of frontend controllers and a series of backend controllers. All backend controllers share a set of common functions in the construct that are copy pasted in all controllers.

If it weren't for the frontend controllers, I would simply create a MY_Controller library and put the functions there, but this is no option, as those function can't be executed for the frontend controller (authentication etc).

This is why I created a Admin_controller library, extending Controller and I extend my backend controllers from this Admin_controller library (I had to include the Admin_controller.php in the top of the page to get it to work, but that's the least...)

However, I now notice that my libraries (that I load in Admin_controller) aren't loaded at all... (I get an error, call to a function on a non-object).

So my question is:
Has anybody gotten this to work in the past

OR

Is there a safe way of retreiving what controller is accessed in MY_Controller, so I could work with an if there. $this->uri->segment isn't safe enough, because some controllers are bypassed by routes.


Messages In This Thread
Extending admin controllers from a general controller - by El Forum - 04-29-2009, 08:20 AM
Extending admin controllers from a general controller - by El Forum - 04-29-2009, 08:26 AM
Extending admin controllers from a general controller - by El Forum - 04-29-2009, 08:31 AM
Extending admin controllers from a general controller - by El Forum - 04-29-2009, 08:36 AM
Extending admin controllers from a general controller - by El Forum - 04-29-2009, 08:43 AM
Extending admin controllers from a general controller - by El Forum - 04-29-2009, 08:44 AM
Extending admin controllers from a general controller - by El Forum - 04-29-2009, 08:59 AM



Theme © iAndrew 2016 - Forum software by © MyBB