views:

73

answers:

1

Hi friends,

I use codeigniter and issue about how to send to view $data and $data_cat2 at same time?

 $data['records'] = $this->gallery_model->get_all(1);
 $data_cat2['records'] = $this->gallery_model->get_all(2);

 $this->load->view('gallery/index.php',$data);

I tried to put an another load->view for $data_cat2. and it just repeated the all page :/

Thanks regards!!! appreciate helps!


sorry for silly question, just sorted it! feel shame to ask that:

 $data['records'] = $this->gallery_model->get_all(1);
 $data['records_cat2'] = $this->gallery_model->get_all(2);

and using the record_cat2 in view file.

A: 

Also, for passing variables outside the load->view() method, use:

$this->load->vars(array('records' => $data, 'records_cat2' => $data_cat2));
$this->load->view('gallery/index');
Joel L