templates/front/catalog/product/pagination.html.twig line 1

Open in your IDE?
  1. {% if currentPath is not defined %}
  2. {% set currentPath = path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) %}
  3. {% endif %}
  4. {% if (nbPages is defined) and (nbPages > 1) %}
  5. <div class="pagination" data-page="{{ app.request.get('page', 1) }}" data-nb="{{ nbPages }}">
  6. <a class="button add-page">
  7. <img src="/img/loading.gif" />
  8. <span>Plus de produit</span>
  9. </a>
  10. <div class="pages">
  11. {% for i in 1..nbPages %}
  12. {% set paginPath = currentPath %}
  13. {% if i > 1 %}
  14. {% set paginPath = currentPath ~ '?page=' ~ i %}
  15. {% endif %}
  16. <a href="{{ paginPath }}" class="{% if i == page %}on{% endif %}" data-page="{{ i }}">{{ i }}</a>
  17. {% endfor %}
  18. </div>
  19. </div>
  20. {% endif %}