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 >>
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
Asked: 2022-06-01 11:00:00 +0000
Seen: 15 times
Last updated: Apr 14 '21