I’m new in CodeIgniter and read user guide from website. Using pagination class, pagination can be made like :
<?php
class Test extends CI_Controller {
function page(){
$this->load->library('pagination');
$config['base_url'] = 'http://localhost/CodeIgniter/index.php/test/page/';
$config['total_rows'] = 20;
$config['per_page'] = 1;
$this->pagination->initialize($config);
echo $this->pagination->create_links();
}
}
?>
But how can I make this pagination with alphabetical order? Thanks…
Codeigniter pagination class is only for creating the navigation links. You have to write your script for populating these pages with data. So in your model query, you have to specify the order_by clause.