1. 程式人生 > >laravel 分頁重新定義

laravel 分頁重新定義

<?php class WeixinPresenter extends Illuminate\Pagination\Presenter { public function getPageLinkWrapper($url, $page) { return '<li><a href="'.$url.'">'.$page.'</a></li>'; } public function getDisabledTextWrapper($text) { return '<li><a style="color:grey;" href= "javascript:void(0)">'
.$text.'</a></li>'; } public function getActivePageWrapper($text) { return '<li><a class="cur" href= "javascript:void(0)">'.$text.'</a></li>'; } } $presenter = new WeixinPresenter($paginator); ?>
<?php if ($paginator->getLastPage() > 1): ?> <div class
="filp">
<ul class="clearfix"> <?php echo $presenter->render(); ?> </ul> </div> <?php endif; ?>

以上是page.balde.php

呼叫方法

 {{$obj->links('page')}}