spqr/vendor/jasongrimes/paginator/examples/pager.phtml

22 lines
883 B
PHTML
Raw Permalink Normal View History

2024-11-05 12:10:06 +08:00
<?php if ($paginator->getNumPages() > 1): ?>
<ul class="pagination">
<?php if ($paginator->getPrevUrl()): ?>
<li><a href="<?php echo $paginator->getPrevUrl(); ?>">&laquo; Previous</a></li>
<?php endif; ?>
<?php foreach ($paginator->getPages() as $page): ?>
<?php if ($page['url']): ?>
<li <?php echo $page['isCurrent'] ? 'class="active"' : ''; ?>>
<a href="<?php echo $page['url']; ?>"><?php echo $page['num']; ?></a>
</li>
<?php else: ?>
<li class="disabled"><span><?php echo $page['num']; ?></span></li>
<?php endif; ?>
<?php endforeach; ?>
<?php if ($paginator->getNextUrl()): ?>
<li><a href="<?php echo $paginator->getNextUrl(); ?>">Next &raquo;</a></li>
<?php endif; ?>
</ul>
<?php endif; ?>