templates/themes/base/common/pagination.html.twig line 1

Open in your IDE?
  1. {% if pageCount > 1 %}
  2.     <ul class="pagination">
  3.     {% if previous is defined %}
  4.         <li>
  5.             <a rel="prev" href="{{ path(route, query|merge({(pageParameterName): previous})) }}">&laquo;&nbsp;{{ 'Previous'|trans }}</a>
  6.         </li>
  7.     {% else %}
  8.         <li class="disabled">
  9.             <span>&laquo;&nbsp;{{ 'Previous'|trans }}</span>
  10.         </li>
  11.     {% endif %}
  12.     {% if startPage > 1 %}
  13.         <li>
  14.             <a href="{{ path(route, query|merge({(pageParameterName): 1})) }}">1</a>
  15.         </li>
  16.         {% if startPage == 3 %}
  17.             <li>
  18.                 <a href="{{ path(route, query|merge({(pageParameterName): 2})) }}">2</a>
  19.             </li>
  20.         {% elseif startPage != 2 %}
  21.         <li class="disabled">
  22.             <span>&hellip;</span>
  23.         </li>
  24.         {% endif %}
  25.     {% endif %}
  26.     {% for page in pagesInRange %}
  27.         {% if page != current %}
  28.             <li>
  29.                 <a href="{{ path(route, query|merge({(pageParameterName): page})) }}">{{ page }}</a>
  30.             </li>
  31.         {% else %}
  32.             <li class="active">
  33.                 <span>{{ page }}</span>
  34.             </li>
  35.         {% endif %}
  36.     {% endfor %}
  37.     {% if pageCount > endPage %}
  38.         {% if pageCount > (endPage + 1) %}
  39.             {% if pageCount > (endPage + 2) %}
  40.                 <li class="disabled">
  41.                     <span>&hellip;</span>
  42.                 </li>
  43.             {% else %}
  44.                 <li>
  45.                     <a href="{{ path(route, query|merge({(pageParameterName): (pageCount - 1)})) }}">{{ pageCount -1 }}</a>
  46.                 </li>
  47.             {% endif %}
  48.         {% endif %}
  49.         <li>
  50.             <a href="{{ path(route, query|merge({(pageParameterName): pageCount})) }}">{{ pageCount }}</a>
  51.         </li>
  52.     {% endif %}
  53.     {% if next is defined %}
  54.         <li>
  55.             <a rel="next" href="{{ path(route, query|merge({(pageParameterName): next})) }}">{{ 'Next'|trans }}&nbsp;&raquo;</a>
  56.         </li>
  57.     {% else %}
  58.         <li class="disabled">
  59.             <span>{{ 'Next'|trans }}&nbsp;&raquo;</span>
  60.         </li>
  61.     {% endif %}
  62.     </ul>
  63. {% endif %}