In my controller I have this line and the models used in it work fine.
$this->load->model('MyModel');
For example at one place I call
$this->MyModel->count_qualified_bus_components(); //update the business comps.
I have another module called MyReport. It is a class that extends
class MyReport extends \koolreport\KoolReport
and it I make a call to My Model. Never mind the crazy KoolReport syntax:
return array(
"datePicker" => $this->dataStore("campaigns23")->get(0,"taxyear"),
"BSelect" => $this->MyModel->getTaxyear()
);
The problem is I get this error:
Severity: Notice
Message: Undefined property: MyReport::$MyModel
Filename: assets/MyReport.php
Line Number: 335
So it appears that functions in MyModel are not callable from this second module. How to fix it? I tried adding in
$this->load->model('MyModel'); to the top of the new module, but this didn't work.
$this->load->model('MyModel');
For example at one place I call
$this->MyModel->count_qualified_bus_components(); //update the business comps.
I have another module called MyReport. It is a class that extends
class MyReport extends \koolreport\KoolReport
and it I make a call to My Model. Never mind the crazy KoolReport syntax:
return array(
"datePicker" => $this->dataStore("campaigns23")->get(0,"taxyear"),
"BSelect" => $this->MyModel->getTaxyear()
);
The problem is I get this error:
Severity: Notice
Message: Undefined property: MyReport::$MyModel
Filename: assets/MyReport.php
Line Number: 335
So it appears that functions in MyModel are not callable from this second module. How to fix it? I tried adding in
$this->load->model('MyModel'); to the top of the new module, but this didn't work.
proof that an old dog can learn new tricks