Welcome Guest, Not a member yet? Register   Sign In
Pass current controller to Loader library.
#2

[eluser]Bramme[/eluser]
The reason why I needed this code was because I need to autoload a few libraries in all but one controllers.

Today, I realised I once read someone suggesting "extending" the controller class and working from there. This seemed like a good idea to me:

In my libraries folder, I created an Admin_controller that extends controller. In the Admin_controller construct I load the libraries and then I adjusted my general.php controller to
Code:
require_once(APPPATH.'/libraries/Admin_controller.php');

class General extends Admin_controller {
}

I was just wondering if this was a good way of approaching this problem, or if there are better ways.


Messages In This Thread
Pass current controller to Loader library. - by El Forum - 07-30-2008, 04:35 PM
Pass current controller to Loader library. - by El Forum - 07-31-2008, 06:48 AM
Pass current controller to Loader library. - by El Forum - 07-31-2008, 07:58 AM
Pass current controller to Loader library. - by El Forum - 07-31-2008, 08:02 AM
Pass current controller to Loader library. - by El Forum - 07-31-2008, 08:10 AM
Pass current controller to Loader library. - by El Forum - 07-31-2008, 08:18 AM
Pass current controller to Loader library. - by El Forum - 07-31-2008, 08:42 AM
Pass current controller to Loader library. - by El Forum - 07-31-2008, 08:58 AM
Pass current controller to Loader library. - by El Forum - 07-31-2008, 09:26 AM
Pass current controller to Loader library. - by El Forum - 07-31-2008, 02:20 PM
Pass current controller to Loader library. - by El Forum - 07-31-2008, 03:53 PM



Theme © iAndrew 2016 - Forum software by © MyBB