app/template/default/pager.twig line 1

Open in your IDE?
  1. {#
  2. This file is part of EC-CUBE
  3. Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  4. http://www.ec-cube.co.jp/
  5. For the full copyright and license information, please view the LICENSE
  6. file that was distributed with this source code.
  7. #}
  8. {% if pages.pageCount > 1 %}
  9.     <ul class="l-pagination__list">
  10.         {# 前へ #}
  11.         {% if pages.previous is defined %}
  12.             <li class="l-pagination__item l-pagination__item--prev">
  13.                 <a href="{{ path(
  14.                 app.request.attributes.get('_route'),
  15.                 app.request.query.all|merge({'pageno': pages.previous})) }}"></a></li>
  16.         {% endif %}
  17.         {# 1ページリンクが表示されない場合、「...」を表示 #}
  18.         {% if pages.firstPageInRange != 1 %}
  19.             <li class="l-pagination__item l-pagination__item--dots">...</li>
  20.         {% endif %}
  21.         {% for page in pages.pagesInRange %}
  22.             {% if page == pages.current %}
  23.                 <li class="l-pagination__item l-pagination__item--active"><a href="{{ path(
  24.                     app.request.attributes.get('_route'),
  25.                     app.request.query.all|merge({'pageno': page})) }}"> {{ page }} </a></li>
  26.             {% else %}
  27.                 <li class="l-pagination__item"><a href="{{ path(
  28.                     app.request.attributes.get('_route'),
  29.                     app.request.query.all|merge({'pageno': page})) }}"> {{ page }} </a></li>
  30.             {% endif %}
  31.         {% endfor %}
  32.         {# 最終ページリンクが表示されない場合、「...」を表示 #}
  33.         {% if pages.last != pages.lastPageInRange %}
  34.             <li class="l-pagination__item l-pagination__item--dots">...</li>
  35.         {% endif %}
  36.         {# 次へ #}
  37.         {% if pages.next is defined %}
  38.             <li class="l-pagination__item l-pagination__item--next">
  39.                 <a href="{{ path(
  40.                 app.request.attributes.get('_route'),
  41.                 app.request.query.all|merge({'pageno': pages.next})) }}"></a></li>
  42.         {% endif %}
  43.     </ul>
  44. {% endif %}