templates/pagination/knp_custom.html.twig line 1

  1. {% if pageCount > 1 %}
  2. <nav class="custom-pagination">
  3.     <ul>
  4.         {# PRIMERO #}
  5.         <li class="{{ current == 1 ? 'disabled' }}">
  6.             <a href="{{ path(route, query|merge({(pageParameterName): 1})) }}">
  7.                 Primero
  8.             </a>
  9.         </li>
  10.         {# ANTERIOR #}
  11.         <li class="{{ previous is not defined ? 'disabled' }}">
  12.             {% if previous is defined %}
  13.                 <a href="{{ path(route, query|merge({(pageParameterName): previous})) }}">
  14.                     ‹
  15.                 </a>
  16.             {% else %}
  17.                 <span>‹</span>
  18.             {% endif %}
  19.         </li>
  20.         {# PÁGINAS #}
  21.         {% for page in pagesInRange %}
  22.             <li class="{{ page == current ? 'active' }}">
  23.                 <a href="{{ path(route, query|merge({(pageParameterName): page})) }}">
  24.                     {{ page }}
  25.                 </a>
  26.             </li>
  27.         {% endfor %}
  28.         {# SIGUIENTE #}
  29.         <li class="{{ next is not defined ? 'disabled' }}">
  30.             {% if next is defined %}
  31.                 <a href="{{ path(route, query|merge({(pageParameterName): next})) }}">
  32.                     ›
  33.                 </a>
  34.             {% else %}
  35.                 <span>›</span>
  36.             {% endif %}
  37.         </li>
  38.         {# ÚLTIMO #}
  39.         <li class="{{ current == pageCount ? 'disabled' }}">
  40.             <a href="{{ path(route, query|merge({(pageParameterName): pageCount})) }}">
  41.                 Último
  42.             </a>
  43.         </li>
  44.     </ul>
  45. </nav>
  46. {% endif %}