我想将一个数组和两个变量传递给我的视图我的数组已成功传递给视图,但是这两个变量是未定义的。谁能帮助我如何将这些值传递给视图。我尝试了索引,然后模型不起作用。
我的控制器
$Semister=$this->input->post('Semister');
$Dept=$this->input->post('Dept');
$this->load->model('Upload_Result_Model');
$data['subjects']=$this->Upload_Result_Model->getAllSubjects($Semister,$Dept);
$data['student']=$this->Upload_Result_Model->getAllStudent($Semister,$Dept);
$this->load->view('Faculty/upload_mid_result',$data,$Dept,$Semister);
我的观点
<h3>Department: <?php echo $Dept;?></h3> //error Undefined variable: Dept
<h3>Semister: <?php echo $Semister;?></h3> ////error Undefined variable: Dept
谁能帮我解决这个问题。除了 $dept 和 $Semister 之外,一切都很好。谢谢我提前