Ask Your Question
4

Is it possible to insert ellipsis between the first and last pages when using codeigniter pagination?

asked 2022-06-01 11:00:00 +0000

pufferfish gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2021-04-14 17:00:00 +0000

djk gravatar image

Yes, it is possible to insert ellipsis between the first and last pages when using CodeIgniter pagination. This can be achieved by using the num_links parameter of the pagination configuration.

Here is an example code to achieve this:

$config['num_links'] = 2; // Number of links to show before/after the current page
$config['ellipses'] = true; // Display ellipses between first/last page link and adjacent number link

$this->pagination->initialize($config);

By setting the num_links parameter to 2, the pagination will display two links before and after the current page link. By enabling the ellipses parameter, ellipses will be displayed between the first/last page link and the adjacent number link.

This will result in a pagination that looks like this:

<< 1 ... 4 5 6 ... 10 >>

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-06-01 11:00:00 +0000

Seen: 15 times

Last updated: Apr 14 '21