I have multiple files that have this name format field1_field2_field3.pdf. I separated each field and I want to return it to the view and paginate it. Can it be done? So far I have managed to explode the filename but only one file is returned to the view. Please help.
Controller :
$this->load->helper('directory');
$map = directory_map('./assets/data/');
$nric = $this->session->userdata('nric');
foreach($map as $row)
{
$separate = explode('_',$row);
}
$data['name'] = $separate[0];
$data['product'] = $separate[1];
$data['policyno'] = substr($separate[2],0,strlen($separate[2])-4);
$this->load->view('includes/user/header');
$this->load->view('user/statements',$data);
$this->load->view('includes/user/footer');
View
<tr>
<td><?php echo $name; ?></td>
<td><?php echo $product; ?></td>
<td><?php echo $policyno; ?></td>
</tr>