Welcome Guest, Not a member yet? Register   Sign In
trouble calling function in model
#1

(This post was last modified: 01-13-2021, 07:09 PM by richb201.)

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. 
proof that an old dog can learn new tricks
Reply


Messages In This Thread
trouble calling function in model - by richb201 - 01-13-2021, 05:23 AM
RE: trouble calling function in model - by iRedds - 01-14-2021, 07:16 AM



Theme © iAndrew 2016 - Forum software by © MyBB