[eluser]w0bbes[/eluser]
[quote author="modelreject" date="1237760719"]Nope. Soooo frustrating.
I have this "$config['per_page']= 1;" but the initial page doesn't limit the results. For example, I have 3 posts in my database. The page displays all 3 but also displays the pagination. Very odd indeed.
Thanks for the help so far.[/quote]
Im having problems also. The pagination is displaying although it just displays all the pictures. It prolly has something to do with my view file.
Controller:
Code:
$data['aantal'] = count($data['fotos']->result());
$config['base_url'] = site_url().'foto/cat/'. $this->uri->segment(3) .'/'. $this->uri->segment(4);
$config['total_rows'] = $data['aantal'];
$config['per_page'] = '4';
$config['uri_segment'] = '5';
$this->pagination->initialize($config);
if($data['aantal'] > $config['per_page']){
$this->pagination->create_links();
}
$this->load->view('fotos',$data);
This is my view file:
Code:
<table class="album">
<tr><td colspan="4">Er zijn <?=$aantal?> fotos gevonden.</td></tr>
<?
$i = '0';
foreach($fotos->result() as $txt){
if($i == '0'){
echo '<tr><td><img >uri->segment(4)) . '/thumb_' . $txt->naam . '"></td>';
$i++;
}elseif($i == '3'){
echo '<td><img >uri->segment(4)) . '/thumb_' . $txt->naam . '"></td></tr>';
$i = '0';
}else{
echo '<td><img >uri->segment(4)) . '/thumb_' . $txt->naam . '"></td>';
$i++;
}
}
?>
<tr><td colspan="4"><?=$this->pagination->create_links()?></td></tr>
</table>
Any help would be appreciated