westdc-zf1/module/Article/view/layout/pagination-news.phtml

42 lines
1.8 KiB
PHTML

<?php if ($this->pageCount): ?>
<?php $route = "news"; ?>
<?php $query = isset($_GET) && count($_GET) ? "?".http_build_query($_GET) :"" ; ?>
<div class="pagination">
<ul>
<?php if (isset($this->previous)): ?>
<li class="first"><a href="<?= $this->url($route, array('page' => $this->first),false,true); ?><?= $query ?>">&lt;&lt; First</a></li>
<?php else: ?>
<li class="prev disabled"><a href="javascript:void(0);">&lt;&lt; First</a></li>
<?php endif; ?>
<!-- Previous page link -->
<?php if (isset($this->previous)): ?>
<li class="prev"><a href="<?= $this->url($route,array('page'=>$this->previous),false,true) ?><?= $query ?>">&lt; Previous</a></li>
<?php else: ?>
<li class="prev disabled"><a href="javascript:void(0);">&lt; Previous</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),false,true) ?><?= $query ?>"><?= $page; ?></a></li>
<?php else: ?>
<li class="active"><a href="javascript:void(0);"><?= $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),false,true) ?><?= $query ?>">Next &gt;</a></li>
<?php else: ?>
<li class="next disabled"><a href="javascript:void(0);">Next &gt;</a></li>
<?php endif; ?>
<!-- Last page link -->
<?php if (isset($this->next)): ?>
<li class="last"><a href="<?= $this->url($route, array('page' => $this->last),false,true); ?><?= $query ?>">Last &gt;&gt;</a></li>
<?php else: ?>
<li class="last disabled"><a href="javascript:void(0);">Last &gt;&gt;</a></li>
<?php endif; ?>
</ul>
</div>
<?php endif; ?>