vendor/knplabs/knp-paginator-bundle/templates/Pagination/twitter_bootstrap_v3_pagination.html.twig line 1

Open in your IDE?
  1. {#
  2. /**
  3. * @file
  4. * Twitter Bootstrap v3 Sliding pagination control implementation.
  5. *
  6. * View that can be used with the pagination module
  7. * from the Twitter Bootstrap CSS Toolkit
  8. * https://getbootstrap.com/docs/3.4/components/#pagination
  9. *
  10. * @author Pablo Díez <[email protected]>
  11. * @author Jan Sorgalla <[email protected]>
  12. * @author Artem Ponomarenko <[email protected]>
  13. * @author Artem Zabelin <[email protected]>
  14. */
  15. #}
  16. {% if pageCount > 1 %}
  17. <ul class="pagination justify-content-center">
  18. {% if previous is defined %}
  19. <li class="page-item">
  20. <a class="page-link" rel="prev" href="{{ path(route, query|merge({(pageParameterName): previous})) }}">&laquo;&nbsp;{{ 'label_previous'|trans([], 'KnpPaginatorBundle') }}</a>
  21. </li>
  22. {% else %}
  23. <li class="disabled page-item">
  24. <a class="page-link">&laquo;&nbsp;{{ 'label_previous'|trans([], 'KnpPaginatorBundle') }}</a>
  25. </li>
  26. {% endif %}
  27. {% if startPage > 1 %}
  28. <li class="page-item">
  29. <a class="page-link" href="{{ path(route, query|merge({(pageParameterName): 1})) }}">1</a>
  30. </li>
  31. {% if startPage == 3 %}
  32. <li class="page-item">
  33. <a class="page-link" href="{{ path(route, query|merge({(pageParameterName): 2})) }}">2</a>
  34. </li>
  35. {% elseif startPage != 2 %}
  36. <li class="disabled page-item">
  37. <a class="page-link">&hellip;</a>
  38. </li>
  39. {% endif %}
  40. {% endif %}
  41. {% for page in pagesInRange %}
  42. {% if page != current %}
  43. <li class="page-item">
  44. <a class="page-link" href="{{ path(route, query|merge({(pageParameterName): page})) }}">{{ page }}</a>
  45. </li>
  46. {% else %}
  47. <li class="active">
  48. <a class="page-link">{{ page }}</a>
  49. </li>
  50. {% endif %}
  51. {% endfor %}
  52. {% if pageCount > endPage %}
  53. {% if pageCount > (endPage + 1) %}
  54. {% if pageCount > (endPage + 2) %}
  55. <li class="disabled page-item">
  56. <a class="page-link">&hellip;</a>
  57. </li>
  58. {% else %}
  59. <li class="page-item">
  60. <a class="page-link" href="{{ path(route, query|merge({(pageParameterName): (pageCount - 1)})) }}">{{ pageCount -1 }}</a>
  61. </li>
  62. {% endif %}
  63. {% endif %}
  64. <li class="page-item">
  65. <a class="page-link" href="{{ path(route, query|merge({(pageParameterName): pageCount})) }}">{{ pageCount }}</a>
  66. </li>
  67. {% endif %}
  68. {% if next is defined %}
  69. <li class="page-item">
  70. <a class="page-link" rel="next" href="{{ path(route, query|merge({(pageParameterName): next})) }}">{{ 'label_next'|trans([], 'KnpPaginatorBundle') }}&nbsp;&raquo;</a>
  71. </li>
  72. {% else %}
  73. <li class="disabled page-item">
  74. <a class="page-link">{{ 'label_next'|trans([], 'KnpPaginatorBundle') }}&nbsp;&raquo;</a>
  75. </li>
  76. {% endif %}
  77. </ul>
  78. {% endif %}