菜谱项目

bootstrap-4.blade.php 1.5KB

12345678910111213141516171819202122232425262728293031323334353637
  1. @if ($paginator->hasPages())
  2. <ul class="pagination">
  3. {{-- Previous Page Link --}}
  4. @if ($paginator->onFirstPage())
  5. <li class="page-item disabled"><span class="page-link">&laquo;</span></li>
  6. @else
  7. <li class="page-item"><a class="page-link" href="{{ $paginator->previousPageUrl() }}" rel="prev">&laquo;</a></li>
  8. @endif
  9. {{-- Pagination Elements --}}
  10. @foreach ($elements as $element)
  11. {{-- "Three Dots" Separator --}}
  12. @if (is_string($element))
  13. <li class="page-item disabled"><span class="page-link">{{ $element }}</span></li>
  14. @endif
  15. {{-- Array Of Links --}}
  16. @if (is_array($element))
  17. @foreach ($element as $page => $url)
  18. @if ($page == $paginator->currentPage())
  19. <li class="page-item active"><span class="page-link">{{ $page }}</span></li>
  20. @else
  21. <li class="page-item"><a class="page-link" href="{{ $url }}">{{ $page }}</a></li>
  22. @endif
  23. @endforeach
  24. @endif
  25. @endforeach
  26. {{-- Next Page Link --}}
  27. @if ($paginator->hasMorePages())
  28. <li class="page-item"><a class="page-link" href="{{ $paginator->nextPageUrl() }}" rel="next">&raquo;</a></li>
  29. @else
  30. <li class="page-item disabled"><span class="page-link">&raquo;</span></li>
  31. @endif
  32. </ul>
  33. @endif