我正在使用來自codeigniter控制器的函數,該函數調用一個叫做付款計劃的模型供我使用。我一直在使用這種方法,但這是我第一次遇到問題。錯誤是 Fatal error: Call to a member function createPaymentPlan() on a non-object in
我不知道我在做什麼錯,但這裏是代碼。致命錯誤:加載codeigniter模型
$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);
}
第二個達到payment_plan它崩潰,即使我已經加載控制器。