Welcome Guest, Not a member yet? Register   Sign In
MY_Controller - I can't get it running
#1

[eluser]breastfed[/eluser]
Hello

i am using the CI Version 2.0.2 and try to manage the following scenario:

I want to load two modells on every page / controller in CI.
So i set up the MY_Controller.php in application/core and put in there:

Code:
<?php
class MY_Controller extends CI_Controller {

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

function MY_Controller()
{
  parent::CI_Controller();
}
}

My Controllers like "home" and so on have "extends MY_Controller", but the output of doing this is:
Quote:Fatal error: Call to undefined method CI_Controller::CI_Controller() in /application/core/MY_Controller.php on line 10

line 10 is: parent::CI_Controller();

What am i doing wrong?

Many thanks!




Theme © iAndrew 2016 - Forum software by © MyBB