Welcome Guest, Not a member yet? Register   Sign In
Extending Application Controller
#4

[eluser]wiredesignz[/eluser]
You do need to require_once MY_main.php manually in your main.php controller class. CI only loads system library and helper (core) extensions automatically.

You might like to autoload the MY_main class as a library. But this will give you a redundant unused object in your application.

Yes to everything else.
Code:
require_once APPPATH.'libraries/MY_Main.php';

class Main extends MY_Main
{
    function Main()
    {
        parent::MY_Main();
    }
}

EDIT:
MY_main is used the moment main is instantiated, the main class actually becomes part of MY_main class, so nothing needs to be redirected or routed.


Messages In This Thread
Extending Application Controller - by El Forum - 07-21-2008, 06:07 AM
Extending Application Controller - by El Forum - 07-21-2008, 06:19 AM
Extending Application Controller - by El Forum - 07-21-2008, 06:50 AM
Extending Application Controller - by El Forum - 07-21-2008, 06:55 AM
Extending Application Controller - by El Forum - 07-21-2008, 06:59 AM
Extending Application Controller - by El Forum - 07-21-2008, 07:03 AM
Extending Application Controller - by El Forum - 07-21-2008, 07:09 AM
Extending Application Controller - by El Forum - 07-21-2008, 07:12 AM
Extending Application Controller - by El Forum - 07-21-2008, 08:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB