我正在使用codeigniter控制器将数据推送到页面
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');
}
Run Code Online (Sandbox Code Playgroud)
但是在它显示的加载页面上,
遇到PHP错误严重性:通知消息:未定义变量:loanPeriod文件名:views/invest_created_basket_view.php行号:9
这是我加载数据的地方.
<input type ="text" value="<?php echo $investAmount; ?>"
<input type ="text" value="<?php echo $loanPeriod ; ?>"
Run Code Online (Sandbox Code Playgroud)
我无法弄清问题是什么.
你有一个简单的拼写错误.它是数组键中的尾随空格'loanPeriod '
$investdata = array(
'investAmount' => $investAmount ,
'loanPeriod' => $loanPeriod,
'pathName' => 'invest'
);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
44 次 |
| 最近记录: |