Welcome Guest, Not a member yet? Register   Sign In
Extending the controller class
#6

[eluser]InsiteFX[/eluser]
MY_Controller need to go into application/libraries

If running CodeIgniter 2.0 MY_Controller needs to go into application/core

Code:
// PHP 5
class MY_Controller extends Controller {
    
    function __construct() {
        parent::__construct();
    }

    function index() {

    }        
}

class Site_Controller extends MY_Controller{
    
    function __construct() {
        parent::__construct();
        
    }

    function index() {

    }
}

class Admin_Controller extends MY_Controller {

    function Admin_Controller() {
        parent::__construct();
    }

    function index() {

    }
}

if you do not have an index function and load a view you will get a blank page.

InsiteFX


Messages In This Thread
Extending the controller class - by El Forum - 10-18-2010, 05:06 PM
Extending the controller class - by El Forum - 10-18-2010, 05:33 PM
Extending the controller class - by El Forum - 10-19-2010, 10:27 AM
Extending the controller class - by El Forum - 10-19-2010, 12:51 PM
Extending the controller class - by El Forum - 10-19-2010, 02:17 PM
Extending the controller class - by El Forum - 10-19-2010, 03:05 PM
Extending the controller class - by El Forum - 10-19-2010, 05:42 PM



Theme © iAndrew 2016 - Forum software by © MyBB