[eluser]Unknown[/eluser]
I have legacy PHP, which queries database and isn't CI at all, in my footer view file. I want to replace this with a MY_Controller which loads the vars to be used later in the views.
I've created a MY_Controller
Code:
class MY_Controller extends CI_Controller {
public function __construct()
{
parent::__construct();
$templatevars['testlol'] = 'yes';
$this->load->vars($templatevars);
}
}
And extended all my controllers, so they use MY_Controller,
Code:
class Page extends MY_Controller {
}
And in my footer view
But then I get an undefined variable of $testlol.
What am I doing wrong?