Php 将数据推送到显示错误的页面

Php 将数据推送到显示错误的页面,php,codeigniter,Php,Codeigniter,我正在使用codeigniter控制器将数据推送到页面 public function trial(){ /* after commiting now show them the next page which will directly allow them to invest */ $usertable =$this->user_profile->getUserTable();

我正在使用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');  
        }
但在加载页面上显示

遇到PHP错误严重性:注意消息:未定义变量:loanPeriod文件名:views/invest\u created\u basket\u view.PHP 电话号码:9

这里是我加载数据的地方

<input type ="text" value="<?php echo $investAmount; ?>" 
<input type ="text" value="<?php echo $loanPeriod ; ?>"

这里有一个简单的打字错误。它是数组键中的尾随空格
'loanPeriod'

$investdata = array(
    'investAmount' => $investAmount ,
    'loanPeriod' => $loanPeriod,
    'pathName' => 'invest'
);

你有一个简单的打字错误。它是数组键中的尾随空格
'loanPeriod'

$investdata = array(
    'investAmount' => $investAmount ,
    'loanPeriod' => $loanPeriod,
    'pathName' => 'invest'
);

“loanPeriod”打字错误。更改为“loanPeriod”(删除尾随空格)“loanPeriod”打字错误。更改为“loanPeriod”(删除尾随空格)没问题,想询问您视图的代码,然后我才注意到拼写错误XD他们已经纠正了拼写错误,但我仍然没有在视图上获得loanPeriod,然后请发布您的视图脚本啊我已经纠正了,谢谢您的回答!!我会在它后面打勾让我:没问题,我想问一下你的视图代码,然后我才注意到打字错误xDHey我修正了打字错误,但我仍然没有在视图上获得loanPeriod然后请发布你的视图脚本啊我修正了,谢谢你的回答!!我会在它后面打勾让我:D