$this->load->model('product/Product_model');
$product_data['p_data'] = $this->Product_model->fetch_data();
$this->load->model('catagory/Catagory_model');
$cdata['catagory_data'] = $this->Catagory_model->getAllcategory();
我想在$ alldata ['all']
中发送 $ product_data ['p_data'] 和 $ cdata ['catagory_data']$this->load->view('product/index',$alldata);
答案 0 :(得分:0)
分配alldata
如下所示:
<?php
$this->load->model('product/Product_model');
$this->load->model('catagory/Catagory_model');
$alldata['p_data'] = $this->Product_model->fetch_data();
$alldata['catagory_data'] = $this->Catagory_model->getAllcategory();;
$this->load->view('product/index',$alldata);
?>
在index
视图中提取alldata。