0
мои моделиcodeigniter- 3 пагинация загрузка всех данных на всех странице
function get_all_events($limit = null, $offset = null) {
if ($limit) {
$this->db->limit($limit, $offset);
}
$this->db->order_by('events.added_on', 'desc');
return $this->db->get('events');
}
мой контроллер
public function manage_events() {
$this->securepage();
$data['events'] = $this->events_model->get_all_events();
$this->load->library('pagination');
$config['base_url'] = site_url('events/manage-events');
$config['total_rows'] = $this->events_model->get_all_events()->num_rows();
$config['per_page'] = 2;
$config['uri_segment'] = 3;
$this->pagination->initialize($config);
$data = array(
'news_title' => 'Manage events | kanchan news.com' ,
'Keywords' => 'manage',
'url' =>'' ,
'content'=> $this->load->view('events/manage', $data, true)
);
$this->load->view('kanchan', $data);
}
Мой вид
<div class="container">
<ol class="breadcrumb">
<li class="active"><?php echo $this->session->userdata('full_name');?></li>
<li class="active">Manage Events</li>
</ol>
<h1>Manage Events here.</h1>
<?php echo $this->session->flashdata('msg'); ?>
<div>
<?php if ($events->num_rows()): ?>
<table class="table table-condensed">
<thead>
<tr>
<th>SN</th>
<th>Add Title</th>
<th>expire date</th>
<th>Added on</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php foreach ($events->result() as $u): ?>
<tr>
<td><?php echo $u->id; ?></td>
<td><a href="<?php echo site_url('events/events-news/'. $u->id.'/'.$u->heading = str_replace(" ", '-', $u->heading));?>" style="text-decoration: none; color:#000;"><?php echo $u->heading = word_limiter($u->heading,10); ?></a></td>
<td><?php echo $u->venue; ?></td>
<td><?php echo date('Y-m-d | h:i:a', $u->added_on); ?></td>
<td>
<a href="<?php echo site_url('events/delete-events/'.$u->id.'/'.$u->heading = str_replace(" ", '-', $u->heading)); ?>" onclick="return confirm('Are you sure want to delete this events?')"><span class="glyphicon glyphicon-trash"></span></a>
    <a href="<?php echo site_url('events/update-events/'.$u->id.'/'.$u->heading= str_replace(" ", '-', $u->heading)); ?>"><span class="glyphicon glyphicon-edit"></span></a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php else: ?>
<p>No any Events
<hr>
<a href="<?php echo site_url('events/create-events');?>" class="btn btn-danger">Add New Events</a>
</p>
<?php endif; ?>
</div>
<?php echo $this->pagination->create_links();?>
</div>
Это создает пагинация < 1 2, но он загружает все результат на странице 1, а также тот же результат на стр. 2, и я пробовал много идей, но это не работает. Я использую codeigniter 3 и mysql.
идеально :) отлично работает, чем ks –
это работает, и у меня были добавлены разбивки на страницы, и дизайн стал перепутанным. Вы можете найти ссылку на ошибку - http://stackoverflow.com/questions/29930992/bootstrap-pagination-in-codeigniter-works-but-design-beome- перепутались вверх –