templates/pagination.html.twig line 1

Open in your IDE?
  1. {% if pageCount > 1 %}
  2.     <nav aria-label="Pagination">
  3.         {% set classAlign = (align is defined) ? " text-#{align}" : '' %}
  4.         <ul class="pagination{{ classAlign }}">
  5.             {% if previous is defined %}
  6.                 <li class="pagination-previous">
  7.                     <a rel="prev" href="{{ path(route, query|merge({(pageParameterName): previous})) }}">
  8.                         Précédent
  9.                     </a>
  10.                 </li>
  11.             {% else %}
  12.                 <li class="pagination-previous disabled">
  13.                     Précédent
  14.                 </li>
  15.             {% endif %}
  16.             {% if startPage > 1 %}
  17.                 <li class="li_not_current">
  18.                     <a href="{{ path(route, query|merge({(pageParameterName): 1})) }}"><span class="number">1</span></a>
  19.                 </li>
  20.                 {% if startPage == 3 %}
  21.                     <li class="li_not_current">
  22.                         <a href="{{ path(route, query|merge({(pageParameterName): 2})) }}"><span class="number">2</span></a>
  23.                     </li>
  24.                 {% elseif startPage != 2 %}
  25.                     <li class="ellipsis"></li>
  26.                 {% endif %}
  27.             {% endif %}
  28.             {% for page in pagesInRange %}
  29.                 {% if page != current %}
  30.                     <li class="li_not_current">
  31.                         <a href="{{ path(route, query|merge({(pageParameterName): page})) }}">
  32.                             <span class="number">{{ page }}</span>
  33.                         </a>
  34.                     </li>
  35.                 {% else %}
  36.                     <li class="current"><span class="number">{{ page }}</span></li>
  37.                 {% endif %}
  38.             {% endfor %}
  39.             {% if pageCount > endPage %}
  40.                 {% if pageCount > (endPage + 1) %}
  41.                     {% if pageCount > (endPage + 2) %}
  42.                         <li class="ellipsis"></li>
  43.                     {% else %}
  44.                         <li class="li_not_current">
  45.                             <a href="{{ path(route, query|merge({(pageParameterName): (pageCount - 1)})) }}">
  46.                                 <span class="number">{{ pageCount -1 }}</span>
  47.                             </a>
  48.                         </li>
  49.                     {% endif %}
  50.                 {% endif %}
  51.                 <li class="li_not_current">
  52.                     <a href="{{ path(route, query|merge({(pageParameterName): pageCount})) }}"><span class="number">{{ pageCount }}</span></a>
  53.                 </li>
  54.             {% endif %}
  55.             {% if next is defined %}
  56.                 <li class="pagination-next">
  57.                     <a rel="next" href="{{ path(route, query|merge({(pageParameterName): next})) }}">
  58.                         Suivant
  59.                     </a>
  60.                 </li>
  61.             {% else %}
  62.                 <li class="pagination-next disabled">
  63.                     Suivant
  64.                 </li>
  65.             {% endif %}
  66.         </ul>
  67.     </nav>
  68. {% endif %}