westdc-zf1/module/Application/view/layout/pagination.phtml

39 lines
1.6 KiB
PHTML

<?php if ($this->pageCount): ?>
<?php $route = 'home/index'; ?>
<ul class="pagination">
<?php if (isset($this->previous)): ?>
<li class="first"><a href="<?php echo $this->url($route, array('page' => $this->first)); ?>">&lt;&lt; 首页</a></li>
<?php else: ?>
<li class="prev disabled"><a href="javascript:void(0);">&lt;&lt; 首页</a></li>
<?php endif; ?>
<!-- Previous page link -->
<?php if (isset($this->previous)): ?>
<li class="prev"><a href="<?= $this->url($route,array('page'=>$this->previous)) ?>">&lt; 前一页</a></li>
<?php else: ?>
<li class="prev disabled"><a href="javascript:void(0);">&lt; 前一页</a></li>
<?php endif; ?>
<!-- Numbered page links -->
<?php foreach ($this->pagesInRange as $page): ?>
<?php if ($page != $this->current): ?>
<li><a href="<?= $this->url($route,array('page'=>$page)) ?>"><?= $page; ?></a></li>
<?php else: ?>
<li class="active"><a href="#"><?= $page; ?></a></li>
<?php endif; ?>
<?php endforeach; ?>
<!-- Next page link -->
<?php if (isset($this->next)): ?>
<li class="next"><a href="<?= $this->url($route,array('page'=>$this->next)) ?>">后一页 &gt;</a></li>
<?php else: ?>
<li class="next disabled"><a href="javascript:void(0);">后一页 &gt;</a></li>
<?php endif; ?>
<!-- Last page link -->
<?php if (isset($this->next)): ?>
<li class="last"><a href="<?php echo $this->url($route, array('page' => $this->last)); ?>">尾页 &gt;&gt;</a></li>
<?php else: ?>
<li class="last disabled"><a href="javascript:void(0);">尾页 &gt;&gt;</a></li>
<?php endif; ?>
</ul>
<?php endif; ?>