zazvorniki
zazvorniki

Reputation: 3602

limit the number of links in codeigniter pagination

I've been working with this for a while now and is sort of driving me a little nutty. I'm sure it's just something silly I'm missing.

I'm working with the codeigniter pagination library to paginate my results. It works wonderfully, but for larger queries the numbers run off the page. Is there anyway to limit the number of links in between the previous and next?

I've tried this

$config['display_pages'] = '1, 2, 3';

and a few other things, but nothing seems to work.

Upvotes: 2

Views: 3960

Answers (1)

vee
vee

Reputation: 4755

It is $config['num_links'] that's work!

for sample:

$config['num_links'] = 3

The pagination will generate 1 2 3 before or after that all included not over 3.

Upvotes: 7

Related Questions