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

Open in your IDE?
  1. {#
  2. /**
  3.  * @file
  4.  * Foundation 5 Sliding pagination control implementation.
  5.  *
  6.  * View that can be used with the pagination module 
  7.  * from the Foundation 5 CSS Toolkit
  8.  * https://get.foundation/sites/docs-v5/components/pagination.html
  9.  *
  10.  * @author Vincent Loy <vincent.loy1@gmail.com>
  11.  *
  12.  * This view have been ported from twitter bootstrap v3 pagination control implementation
  13.  * from:
  14.  * @author Pablo Díez <pablodip@gmail.com>
  15.  * @author Jan Sorgalla <jsorgalla@gmail.com>
  16.  * @author Artem Ponomarenko <imenem@inbox.ru>
  17.  * @author Artem Zabelin <artjomzabelin@gmail.com>
  18.  */
  19. #}
  20. {% if pageCount > 1 %}
  21.     <ul class="pagination">
  22.         {% if previous is defined %}
  23.                  <li class="arrow">
  24.                      <a rel="prev" href="{{ path(route, query|merge({(pageParameterName): previous})) }}">&laquo; {{ 'label_previous'|trans({}, 'KnpPaginatorBundle') }}</a>
  25.                  </li>
  26.         {% else %}
  27.             <li class="arrow unavailable">
  28.                 <a>
  29.                     &laquo; {{ 'label_previous'|trans({}, 'KnpPaginatorBundle') }}
  30.                 </a>
  31.             </li>
  32.         {% endif %}
  33.         {% if startPage > 1 %}
  34.             <li>
  35.                 <a href="{{ path(route, query|merge({(pageParameterName): 1})) }}">1</a>
  36.             </li>
  37.             {% if startPage == 3 %}
  38.                 <li>
  39.                     <a href="{{ path(route, query|merge({(pageParameterName): 2})) }}">2</a>
  40.                 </li>
  41.             {% elseif startPage != 2 %}
  42.                 <li class="unavailable">
  43.                     <a>&hellip;</a>
  44.                 </li>
  45.             {% endif %}
  46.         {% endif %}
  47.         {% for page in pagesInRange %}
  48.             {% if page != current %}
  49.                 <li>
  50.                     <a href="{{ path(route, query|merge({(pageParameterName): page})) }}">
  51.                         {{ page }}
  52.                     </a>
  53.                 </li>
  54.             {% else %}
  55.                 <li class="current">
  56.                     <a>{{ page }}</a>
  57.                 </li>
  58.             {% endif %}
  59.         {% endfor %}
  60.         {% if pageCount > endPage %}
  61.             {% if pageCount > (endPage + 1) %}
  62.                 {% if pageCount > (endPage + 2) %}
  63.                     <li class="unavailable">
  64.                         <a>&hellip;</a>
  65.                     </li>
  66.                 {% else %}
  67.                     <li>
  68.                         <a href="{{ path(route, query|merge({(pageParameterName): (pageCount - 1)})) }}">
  69.                             {{ pageCount -1 }}
  70.                         </a>
  71.                     </li>
  72.                 {% endif %}
  73.             {% endif %}
  74.             <li>
  75.                 <a href="{{ path(route, query|merge({(pageParameterName): pageCount})) }}">{{ pageCount }}</a>
  76.             </li>
  77.         {% endif %}
  78.         {% if next is defined %}
  79.             <li class="arrow">
  80.                 <a rel="next" href="{{ path(route, query|merge({(pageParameterName): next})) }}">
  81.                     {{ 'label_next'|trans({}, 'KnpPaginatorBundle') }} &nbsp;&raquo;
  82.                 </a>
  83.             </li>
  84.         {% else %}
  85.             <li class="arrow unavailable">
  86.                 <a>
  87.                     {{ 'label_next'|trans({}, 'KnpPaginatorBundle') }} &nbsp;&raquo;
  88.                 </a>
  89.             </li>
  90.         {% endif %}
  91.     </ul>
  92. {% endif %}