[eluser]MrMahi[/eluser]
Hi,
I have a problem using the pagination helper and don't understand why.
The pagination links were building but when I click on them nothing happened.
In the description the pagination class looks very simple.
Model:
Code:
public function get_teams()
{
$this->db->order_by('stars', 'desc');
$this->db->order_by('teamname', 'asc');
$query = $this->db->get('fifateams', 10);
return $query->result_array();
}
Controller:
Code:
public function teams()
{
$config['base_url'] = 'http://localhost/unendlicheliste/index.php/fifa/teams';
$config['total_rows'] = $this->db->get('fifateams')->num_rows();
$config['per_page'] = 10;
$config['uri_segment'] = 3;
$this->pagination->initialize($config);
$data['fifateams'] = $this->fifa_model->get_teams();
$data['title'] = lang('title_fifa_teams');
$menu['players'] = $this->menu_model->get_playersmenu();
$this->load->view('templates/header', $data);
$this->load->view('templates/menu', $menu);
$this->load->view('fifa/teams', $data);
$this->load->view('templates/footer');
}
View:
Code:
<?php
echo heading(lang('h1_fifa_teams'), 1);
?>
<table class="table-bordered table-striped" cellpadding="0">
<?php foreach ($fifateams as $fifateams_item): ?>
<tr>
<td><?php echo $fifateams_item['teamname']; ?></td>
<td >
<?php echo $fifateams_item['stars'];?>
</td>
<td ><img src="http://localhost/eternallist-rl/img/teams/<?php echo $fifateams_item['img_url']; ?>" class="img-wappen" /></td>
</tr>
<?php endforeach ?>
</table>
<div class="pagination">
<ul>
<li><?php echo $this->pagination->create_links();?></li>
</ul>
</div>
Any ideas?
Kind Regards,
Jens