[eluser]Media Gearhead[/eluser]
So this code used to work for me in CI 1.7.* but now it is causing issues in CI 2
Worked in CI 1.7.x
Code:
class Error404 extends Controller {
function __construct(){
parent::Controller();
$this->data = array('page_title','Page not found 404');
}
function index(){
echo $this->data['page_title'];
}
}
Doesn't work in CI 2
Code:
class Error404 extends CI_Controller {
function __construct(){
parent::__construct();
$this->data = array('page_title','Page not found 404');
}
function index(){
echo $this->data['page_title'];
}
}
I am not sure what is happening that is different. I have tried changing parent::__construct(); to parent::Controller(); and parent::CI_Controller(); and every other combination I can think of.
I just want to be able to pass data from the construct to the other functions and I can't get the syntax right.