[eluser]cahva[/eluser]
If you are going to use PHP5 style __construct, use it also in the parent::__construct() to be consistent. Oh yeah and parent::Controller; != parent::Controller(); so add those () to the end.
My_Controller.php
Code:
Class MY_Controller extends Controller
{
function __construct()
{
parent::__construct();
}
}
class Auth_Controller extends MY_Controller
{
function __construct()
{
parent::__construct();
$this->load->library('Ion_auth');
if (!$this->ion_auth->loggedin())
{
header('Location: /auth/create_user');
}
}
}
home.php
Code:
if (! defined('BASEPATH')) exit('No direct script access');
class Home extends Auth_Controller {
function __construct()
{
parent::__construct();
}
function index() {
$this->load->view('home');
}
}
If that still doesnt work, make sure you have copied MY_Controller.php to the libraries folder, not controllers(someone might get confused with this).