app/template/uarts/pager.twig line 1

Open in your IDE?
  1. {% if pages.pageCount > 1 %}
  2. <ul class="pager">
  3.     {# 前へ #}
  4.     {% if pages.previous is defined %}
  5.     <li class="ec-pager__item">
  6.         <a href="{{ path(
  7.         app.request.attributes.get('_route'),
  8.         app.request.query.all|merge({'pageno': pages.previous})) }}" class="arrow_btn prev">{{ '前へ'|trans }}</a>
  9.     </li>
  10.     {% endif %}
  11.     {# 1ページリンクが表示されない場合、「...」を表示 #}
  12.     {% if pages.firstPageInRange != 1 %}
  13.     <li class="ec-pager__item">...</li>
  14.     {% endif %}
  15.     {% for page in pages.pagesInRange %}
  16.     {% if page == pages.current %}
  17.     <li class="ec-pager__item--active"><a href="{{ path(
  18.             app.request.attributes.get('_route'),
  19.             app.request.query.all|merge({'pageno': page})) }}" class="current"> {{ page }} </a></li>
  20.     {% else %}
  21.     <li class="ec-pager__item"><a href="{{ path(
  22.             app.request.attributes.get('_route'),
  23.             app.request.query.all|merge({'pageno': page})) }}" class="pager_btn"> {{ page }} </a></li>
  24.     {% endif %}
  25.     {% endfor %}
  26.     {# 最終ページリンクが表示されない場合、「...」を表示 #}
  27.     {% if pages.last != pages.lastPageInRange %}
  28.     <li class="ec-pager__item">...</li>
  29.     {% endif %}
  30.     {# 次へ #}
  31.     {% if pages.next is defined %}
  32.     <li class="ec-pager__item">
  33.         <a href="{{ path(
  34.         app.request.attributes.get('_route'),
  35.         app.request.query.all|merge({'pageno': pages.next})) }}" class="arrow_btn next">{{ '次へ'|trans }}</a>
  36.     </li>
  37.     {% endif %}
  38. </ul>
  39. {% endif %}