templates/includes/pagination.html.twig line 1

Open in your IDE?
  1. {#
  2. Knp\Component\Pager\Paginator
  3. Ref/Doc: https://pimcore.com/docs/pimcore/current/Development_Documentation/Objects/Working_with_PHP_API.html#page_Working-with-Knp-Component-Pager-Paginator
  4. #}
  5. <div>
  6.     <ul class="uk-pagination uk-flex-center">
  7.         {%  if (paginationVariables.current != paginationVariables.first) and (paginationVariables.first is defined) and (paginationVariables.current > paginationVariables.first + 2) %}
  8.             <li class="page-item">
  9.                 <a class="page-link first" href="{{  pimcore_url({'page': paginationVariables.first}) }}" aria-label="First">
  10.                     <span aria-hidden="true"><<</span>
  11.                 </a>
  12.             </li>
  13.         {% endif %}
  14.         {%  if (paginationVariables.previous is defined) %}
  15.             <li class="page-item">
  16.                 <a class="page-link prev" href="{{  pimcore_url({'page': paginationVariables.previous}) }}" aria-label="Previous">
  17.                     <span aria-hidden="true"><</span>
  18.                 </a>
  19.             </li>
  20.         {%  endif %}
  21.         
  22.         {%  for page in paginationVariables.pagesInRange %}
  23.             {% if paginationVariables.pagesInRange|length > 1 %}
  24.                 {%  if (paginationVariables.current == page) %}
  25.                     <li class="page-item uk-active" aria-current="page">
  26.                         <span class="page-link">
  27.                         {{  page }}
  28.                         <span class="sr-only">(current)</span>
  29.                         </span>
  30.                     </li>
  31.                 {%  else %}
  32.                     <li class="page-item"><a class="page-link" href="{{  pimcore_url({'page': page}) }}">{{ page }}</a></li>
  33.                 {%  endif %}
  34.             {% endif %}
  35.         {% endfor %}
  36.         {%  if(paginationVariables.next is defined) %}
  37.             <li class="page-item">
  38.                 <a class="page-link next" href="{{  pimcore_url({'page': paginationVariables.next}) }}" aria-label="Next">
  39.                     <span class="flip" aria-hidden="true">></span>
  40.                 </a>
  41.             </li>
  42.         {%  endif %}
  43.         {%  if (paginationVariables.current != paginationVariables.last) and (paginationVariables.last is defined) and (paginationVariables.current < paginationVariables.last - 2) %}
  44.             <li class="page-item">
  45.                 <a class="page-link first" href="{{  pimcore_url({'page': paginationVariables.last}) }}" aria-label="First">
  46.                     <span aria-hidden="true">>></span>
  47.                 </a>
  48.             </li>
  49.         {% endif %}
  50.     </ul>
  51. </div>