我使用笨控制器將數據推送到頁面顯示錯誤
public function trial(){
/* after commiting now show them the next page which will directly allow them to invest */
$usertable =$this->user_profile->getUserTable();
$userId = $usertable['ORIG_ID'];
$facebookId = $this->Facebook->getUser();
$sidebarData = array(
'userName' => $this->user_profile->getUserName(),
'facebookId' => $facebookId,
'caller' => 'investment_bucket'
);
$headerData = array(
$this->history->getPreviousPageInArray(),
'userName' => $this->user_profile->getUserName(),
'facebookId' => $facebookId
);
$investAmount = 100;
$loanPeriod = 60;
$investdata = array(
'investAmount' => $investAmount ,
'loanPeriod ' => $loanPeriod,
'pathName' => 'invest'
);
$this->load->view('header', $headerData);
$this->load->view('borrower_sidebar_view', $sidebarData);
$this->load->view("invest_created_basket_view",$investdata);
$this->load->view('footer');
}
但加載頁面它顯示,
一個PHP錯誤遇到嚴重將數據推送到頁面:公告信息:未定義的變量:loanPeriod文件名:觀點/ invest_created_basket_view.php 行號:9
這裏是我在哪裏加載DAT一個。
<input type ="text" value="<?php echo $investAmount; ?>"
<input type ="text" value="<?php echo $loanPeriod ; ?>"
我不知道問題是什麼。
'loanPeriod'typo。更改爲'loanPeriod'(刪除尾部空白) –