Created
August 6, 2015 19:21
-
-
Save atorscho/37ed39659bb0396dfc37 to your computer and use it in GitHub Desktop.
Custom pagination view template for Laravel 5.x projects.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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