I am using a function from codeigniter controller which calls a model called payment plan for me to use. I have been using this method all over the place but this is the first time I am getting a problem with it. The error is
Fatal error: Call to a member function createPaymentPlan() on a non-object in
I am not sure what I am doing wrong but here is the code.
$this->load->model("payment_plan");
$this->load->model("fee_page");
foreach ($itemdetails as $itemdetail) {
$Amount = $itemdetail["borrowOrInvestAmount"];
$currency = $itemdetail["Currency"];
$Interest = $itemdetail["Interest"];
$Loantime = (isset($data['Loantime']) && $data['Loantime'] > 0) ? $data['Loantime'] : $itemdetail["Loantime"];
$start_date = $data["start_date"];
$payment_term = $data["payment_term"];
$paymenPlanSingle = $this->payment_plan->createPaymentPlan($Amount, $currency, $Interest, $Loantime, $start_date, $payment_term);
$countOfElements = count($paymenPlanSingle);
}
The second it reaches payment_plan it crashes even though I loaded the controller already.