I have created a foreach loop in my view to get the content that I have requested from the database fullpath = full image and description = alt tag but it does not seem to be passing the data through into the content view:
View
<?php if(is_array($get_images)): ?>
<?php foreach($get_images as $image): ?>
<img src ="<?=base_url()?>includes/uploads/gallery/<?=$image->fullpath?>" alt="<?= $image->description?>">
<?php endforeach; ?>
<?php endif; ?>
Controller
$data['cms_pages'] = $this->navigation_model->getCMSPages();
$data['get_images'] = $this->image_model->getImages();
$data['title'] = 'Delete Gallery Image';
$data['content'] = $this->load->view('admin/deleteimage',NULL,TRUE);
$this->load->view('admintemplate', $data);
Model
function getImages() {
$query = $this->db->get('images');
if($query->num_rows() > 0) return $query->result();
}
Your ‘Images’ data should be in a differnt array.
try;