[eluser]hal10001[/eluser]
[quote author="pistolPete" date="1236114666"]Another approach, which I think is better because it's better structured, is extending the controller class:
MY_Controller.php
Code:
class Auth_controller extends Controller
{
function Auth_controller()
{
parent::Controller();
// do the auth stuff here
}
}
Admin.php
Code:
class Admin extends Auth_controller
{
function Admin()
{
parent::Auth_controller();
(...)
}
}
[/quote]
This approach worked well for me (although I used the generic MY_Controller name instead of Auth_controller), and I think it fits within the OO paradigm. If I had a need to extend the Controller from other points in the application I would need to rethink how I would want my custom controller structured, but this gets me going in the right direction. I suppose that is why I have read where some other developers request the ability to extend core classes more than once.