templates/components/_pagination.html.twig line 1

Open in your IDE?
  1. {% set _currentRoute = app.request.attributes.get('_route') %}
  2. {% set _currentParams = app.request.query.all %}
  3. {% if path_params is defined %}
  4.     {% set _currentParams = _currentParams|merge(path_params) %}
  5. {% endif %}
  6. {% if paginate.hasPagination %}
  7. <ul class="c_pagination">
  8.     {% if not paginate.isFirstPage %}
  9.     <li class="c_pagination__item c_pagination__item--first">
  10.         <a href="{{ path(_currentRoute, _currentParams|merge({page: 1})) }}" class="c_pagination__item_anchor">
  11.             <img src="{{ asset('build/images/common/arrow_black.svg') }}" alt="" class="c_pagination__item_arrow">
  12.         </a>
  13.     </li>
  14.     {% endif %}
  15.     {% for i in paginate.getSlidingPageList(4) %}
  16.     {% if i == paginate.getCurrentPage %}
  17.     <li class="c_pagination__item c_pagination__item--active">
  18.         <p class="page-link">{{ i }}</p>
  19.     </li>
  20.     {% else %}
  21.     <li class="c_pagination__item">
  22.         <a href="{{ path(_currentRoute, _currentParams|merge({page: i})) }}" class="c_pagination__item_anchor">
  23.             {{ i }}
  24.         </a>
  25.     </li>
  26.     {% endif %}
  27.     {% endfor %}
  28.     {% if not paginate.isLastPage %}
  29.     <li class="c_pagination__item c_pagination__item--last">
  30.         <a href="{{ path(_currentRoute, _currentParams|merge({page: paginate.getTotalPage})) }}" class="c_pagination__item_anchor">
  31.             <img src="{{ asset('build/images/common/arrow_black.svg') }}" alt="" class="c_pagination__item_arrow">
  32.         </a>
  33.     </li>
  34.     {% endif %}
  35. </ul>
  36. {% endif %}