* @param Zend\Paginator $this->paginator
*/
use Blossom\Classes\Url;
if ($this->paginator->count() > 1) {
$pages = $this->paginator->getPages();
$url = new Url($_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']);
$url->purgeEmptyParameters();
echo '
';
// Show the Back button
if (isset($pages->previous)) {
$url->page = $pages->first;
echo "- First
";
$url->page = $pages->previous;
echo "- Back
";
}
// Show the page number links
// Show only $maxNumLinks pages at a time
foreach ($pages->pagesInRange as $page) {
$url->page = $page;
$class = ($page == $pages->current) ? 'class="current"' : '';
echo "- $page
";
}
// Show the Next button
if (isset($pages->next)) {
$url->page = $pages->next;
echo "- Next
";
$url->page = $pages->last;
echo "- Last
";
}
echo '
';
}