Welcome Guest, Not a member yet? Register   Sign In
pagination library hide some links
#1

(This post was last modified: 04-18-2016, 06:03 PM by insik.)

My codeigniter pagination library is creating the links like this.
If I have 8 pages

1 2 3 4 5 6 7 8 >>

My question is how to hide some links if it is more than 5 links.
like this

1 2 3 4 5 ... >>

Thanks.
Reply
#2

(This post was last modified: 04-18-2016, 10:06 PM by Wouter60.)

Use $config['num_links'] = .. to set the number of “digit” links you would like before and after the selected page number. For example, the number 2 will place two digits on either side.

Example:
PHP Code:
$this->load->library('pagination');

$config['base_url'] = 'http://example.com/index.php/test/page/';
$config['total_rows'] = 200;
$config['per_page'] = 20;
$config['num_links'] = 2;

$this->pagination->initialize($config); 
Reply
#3

Hi

You can use
$config[‘num_links’] = 2;

For more help visit below link:
http://www.codeigniter.com/user_guide/li...nation.htm
Reply




Theme © iAndrew 2016 - Forum software by © MyBB