Skip to content

Instantly share code, notes, and snippets.

@kimisgold
Created May 24, 2012 19:53
Show Gist options
  • Save kimisgold/2783832 to your computer and use it in GitHub Desktop.
Save kimisgold/2783832 to your computer and use it in GitHub Desktop.
2.0 pagination
<?php if ($this->pageCount > 1): ?>
<?php $getParams = $_GET; ?>
<form action="" method="get" accept-charset="utf-8">
<ul class="pagination">
<?php if (isset($this->previous)): ?>
<!-- Previous page link -->
<li class="pagination_previous">
<?php $getParams['page'] = $previous; ?>
<a href="<?php echo html_escape($this->url(array(), null, $getParams)); ?>"><?php echo __('<'); ?></a>
</li>
<?php endif; ?>
<li class="page-input">
<?php echo $this->formHidden($this->url(array(), null, $getParams)); ?>
<?php echo $this->formText('page', $this->current, array('class'=>'textinput')); ?> of <?php echo $this->last; ?></li>
<?php if (isset($this->next)): ?>
<!-- Next page link -->
<li class="pagination_next">
<?php $getParams['page'] = $next; ?>
<a href="<?php echo html_escape($this->url(array(), null, $getParams)); ?>"><?php echo __('>'); ?></a>
</li>
<?php endif; ?>
</ul>
</form>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment