Skip to content

Instantly share code, notes, and snippets.

@atorscho
Created August 6, 2015 19:21
Show Gist options
  • Save atorscho/37ed39659bb0396dfc37 to your computer and use it in GitHub Desktop.
Save atorscho/37ed39659bb0396dfc37 to your computer and use it in GitHub Desktop.
Custom pagination view template for Laravel 5.x projects.
<?php
namespace App\Http;
use Illuminate\Pagination\BootstrapThreePresenter;
class SemanticUIPagination extends BootstrapThreePresenter
{
public function getActivePageWrapper($text)
{
return '<a class="active item">' . $text . '</a>';
}
public function getDisabledTextWrapper($text)
{
return '<div class="disabled item">' . $text . '</div>';
}
public function getAvailablePageWrapper($url, $page, $rel = null)
{
return '<a class="item" href="' . $url . '">' . $page . '</a>';
}
public function render()
{
if ($this->hasPages()) {
return sprintf('<div class="center aligned"><div class="ui pagination menu">%s %s %s</div></div>', $this->getPreviousButton('<i class="left arrow icon"></i>'), $this->getLinks(), $this->getNextButton('<i class="right arrow icon"></i>'));
}
return '';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment