Last active
August 29, 2015 14:06
A simple paginator with ZF2 and Bootstrap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ($this->pageCount): ?> | |
<ul class="pagination"> | |
<!-- Previous page link --> | |
<?php if (isset($this->previous)): ?> | |
<li><a href="<?php echo $this->url($this->route, array('controller' => $this->controller, 'page' => $this->previous)); ?>">«</a></li> | |
<?php else: ?> | |
<li class="disabled"><a>«</a></li> | |
<?php endif; ?> | |
<?php foreach ($this->pagesInRange as $page): ?> | |
<?php if ($page != $this->current): ?> | |
<li><a href="<?php echo $this->url($this->route, array('controller' => $this->controller, 'page' => $page)); ?>"><?php echo $page ?></a></li> | |
<?php else: ?> | |
<li class="active"><a href="<?php echo $this->url($this->route, array('controller' => $this->controller, 'page' => $page)); ?>"><?php echo $page ?></a></li> | |
<?php endif; ?> | |
<?php endforeach; ?> | |
<!-- Next page link --> | |
<?php if (isset($this->next)): ?> | |
<li><a href="<?php echo $this->url($this->route, array('controller' => $this->controller, 'page' => $this->next)); ?>">»</a></li> | |
<?php else: ?> | |
<li class="disabled"><a>»</a></li> | |
<?php endif; ?> | |
</ul> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment