📜  laravel 中的自定义分页 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:48.859000             🧑  作者: Mango

代码示例6
@if (isset($paginator) && $paginator->lastPage() > 1)

    
    currentPage() - $interval; if($from < 1){ $from = 1; } $to = $paginator->currentPage() + $interval; if($to > $paginator->lastPage()){ $to = $paginator->lastPage(); } ?> @if($paginator->currentPage() > 1)
  • @endif @for($i = $from; $i <= $to; $i++) currentPage() == $i; ?>
  • {{ $i }}
  • @endfor @if($paginator->currentPage() < $paginator->lastPage())
  • @endif
@endif