Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Customize Pagination

Hello Friends, Currently I am using default pagination provided by phalcon framework which is working fine. It looks something like below:

For Example : First Previous Next Last 1/71

And Code for above is :

<td><?php echo $this->tag->linkTo("userdashboard/rediscover", "First") ?></td>
<td><?php echo $this->tag->linkTo("userdashboard/rediscover?page=" . $page_rediscover->before, "Previous") ?></td>
<td><?php echo $this->tag->linkTo("userdashboard/rediscover?page=" . $page_rediscover->next, "Next") ?></td>
<td><?php echo $this->tag->linkTo("userdashboard/rediscover?page=" . $page_rediscover->last, "Last") ?></td>
<td><?php echo $page_rediscover->current, "/", $page_rediscover->total_pages ?></td>

My requirement is something like: 1 2 3 Next ›Last »

How it can be done pls help me!!!



56.6k
Accepted
answer

"Something like" isn't very exact, so there is still some different possibilities. Basically though, the paginator can tell you what page you're on. You can do some logic then, to conditionally output a link to the current page + 1, or the current page - 1.